Sha256: 18f756e6b6df7b4449c90d73fbbe47ff9802d4267ce7076836581cbc07e69260

Contents?: true

Size: 312 Bytes

Versions: 22

Compression:

Stored size: 312 Bytes

Contents

FactoryBot.define do
  factory :image, class: Spree::Image do
    before(:create) do |image|
      if image.class.method_defined?(:attachment)
        image.attachment.attach(io: File.new(Spree::Core::Engine.root + 'spec/fixtures' + 'thinking-cat.jpg'), filename: 'thinking-cat.jpg')
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
spree_core-4.10.1 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.10.0 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.9.0 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.8.3 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.8.2 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.7.3 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.6.6 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.5.5 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.5.4 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.6.5 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.7.2 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.7.1 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.6.4 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.7.0 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.6.3 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.6.2 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.6.1 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.6.0 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.5.3 lib/spree/testing_support/factories/image_factory.rb
spree_core-4.5.2 lib/spree/testing_support/factories/image_factory.rb