Created
July 14, 2014 01:28
-
-
Save mvidaurre/7cd938987929de9b1121 to your computer and use it in GitHub Desktop.
Adding create attached images in Product Factory
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
after(:create) do |product| | |
image = File.open(File.expand_path('../../fixtures/thinking-cat.jpg', __FILE__)) | |
product.images.create!(attachment: image) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment