Skip to content

Instantly share code, notes, and snippets.

View taniadaniela's full-sized avatar

tania daniela paiva taniadaniela

View GitHub Profile
@taniadaniela
taniadaniela / product_factory.rb
Last active August 29, 2015 14:26
factory for add an image to a spree product
FactoryGirl.define do
factory :product_with_image, parent: :product do
after :create do |p|
image = File.open("spec/support/images/image.jpg")
p.images.create!(attachment: image, alt: p.name)
end
end
end