Allow other directories to be specified when accessing fixtures.
This commit is contained in:
parent
3ea68f8f6c
commit
9a6f54de6c
|
@ -140,9 +140,9 @@ Spork.prefork do
|
|||
Time.stubs(:now).returns(time)
|
||||
end
|
||||
|
||||
def file_from_fixtures(filename)
|
||||
def file_from_fixtures(filename, directory="images")
|
||||
FileUtils.mkdir_p("#{Rails.root}/tmp/spec") unless Dir.exists?("#{Rails.root}/tmp/spec")
|
||||
FileUtils.cp("#{Rails.root}/spec/fixtures/images/#{filename}", "#{Rails.root}/tmp/spec/#{filename}")
|
||||
FileUtils.cp("#{Rails.root}/spec/fixtures/#{directory}/#{filename}", "#{Rails.root}/tmp/spec/#{filename}")
|
||||
File.new("#{Rails.root}/tmp/spec/#{filename}")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue