Skip to content

Instantly share code, notes, and snippets.

@mvidaurre
Created July 14, 2014 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mvidaurre/7cd938987929de9b1121 to your computer and use it in GitHub Desktop.
Save mvidaurre/7cd938987929de9b1121 to your computer and use it in GitHub Desktop.
Adding create attached images in Product Factory
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