Skip to content

Instantly share code, notes, and snippets.

Created February 24, 2010 05:05
Show Gist options
  • Save anonymous/313121 to your computer and use it in GitHub Desktop.
Save anonymous/313121 to your computer and use it in GitHub Desktop.
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
@ilatif
Copy link

ilatif commented Jun 19, 2013

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)

@srogers
Copy link

srogers commented Oct 25, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment