FIX: don't mess with fixtures when running the specs

This commit is contained in:
Régis Hanol
2014-07-14 17:34:23 +02:00
parent 186ce78cb5
commit b5c57fa947
8 changed files with 18 additions and 13 deletions

View File

@ -110,6 +110,12 @@ Spork.prefork do
Time.stubs(:now).returns(Time.parse(now.to_s))
end
def file_from_fixtures(filename)
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}")
File.new("#{Rails.root}/tmp/spec/#{filename}")
end
end
Spork.each_run do