Module: Spree::TestingSupport::ImageHelpers
- Defined in:
- lib/spree/testing_support/image_helpers.rb
Instance Method Summary collapse
Instance Method Details
#create_image(attachable, file) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/spree/testing_support/image_helpers.rb', line 4 def create_image(attachable, file) image = attachable.images.new image..attach(io: file, filename: File.basename(file)) image.save! file.rewind image end |