Created
February 24, 2010 05:05
-
-
Save anonymous/313121 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Factory.define :item do |f| | |
include ActionDispatch::TestProcess | |
f.name "Macbook Pro 15" | |
f.price_in_dollars 1500 | |
f.photo fixture_file_upload('/files/avatar.jpg', 'image/jpg') | |
end |
This seems like a relevant point:
http://pivotallabs.com/avoid-using-fixture-file-upload-with-factorygirl-and-paperclip/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice Gist.
But
f.photo fixture_file_upload('/files/avatar.jpg', 'image/jpg')
was not working for me.fixture_file_upload
should be wrapped in{}
. See here thoughtbot/factory_bot#276 (comment)