Skip to content

Instantly share code, notes, and snippets.

@debprado
Forked from anonymous/factories.rb
Created August 3, 2011 19:52
Show Gist options
  • Save debprado/1123605 to your computer and use it in GitHub Desktop.
Save debprado/1123605 to your computer and use it in GitHub Desktop.
factory attachment rails 3
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment