Skip to content

Instantly share code, notes, and snippets.

@robertomiranda
Forked from anonymous/factories.rb
Created January 6, 2012 20:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save robertomiranda/1572280 to your computer and use it in GitHub Desktop.
Save robertomiranda/1572280 to your computer and use it in GitHub Desktop.
Simulate Paperclip Attachments With FactoryGirl
Factory.define :item do |f|
include ActionDispatch::TestProcess
f.name "Macbook Pro 15"
f.price_in_dollars 1500
f.photo Rack::Test::UploadedFile.new(File.join(Rails.root, 'spec', 'support', 'rails.png'), 'image/png')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment