Skip to content

Instantly share code, notes, and snippets.

@nuna
Created February 16, 2012 11:39
Show Gist options
  • Save nuna/1844266 to your computer and use it in GitHub Desktop.
Save nuna/1844266 to your computer and use it in GitHub Desktop.
factory_girl + Rails 3.2.1 / legacy fanctional test
class FactoryGirl::TestHelper
include ActionDispatch::TestProcess
def self.fixture_file_upload(*args)
self.new.fixture_file_upload(*args)
end
def self.fixture_path
File.join(File.dirname(__FILE__) + '/fixtures/')
end
end
Factory.define :file do |f|
f.asset { FactoryGirl::TestHelper.fixture_file_upload('/files/logo.png', 'image/png', true) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment