Sha256: 95b0df4def847e78bd9d5b037fef216b561aca293e3a2f8bfe9d1fd88a525abf

Contents?: true

Size: 607 Bytes

Versions: 49

Compression:

Stored size: 607 Bytes

Contents

FactoryBot.define do
  factory :cmor_carousels_item_detail, class: Cmor::Carousels::ItemDetail do
    association :carousel, factory: :cmor_carousels_carousel
    after(:build) { |resource|
      assets = resource.carousel.assets.attach(
        io:           File.open(Cmor::Carousels::Engine.root.join(*%w(spec files cmor carousels item_details example.png))),
        filename:     'example.png',
        content_type: 'image/png'
      )
      if Rails.version < "6.0.0"
        resource.asset = assets.first
      else
        resource.asset = resource.carousel.assets.first
      end
    }
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
cmor_carousels-0.0.37.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.36.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.35.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.34.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.33.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.32.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.31.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.30.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.29.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.28.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.27.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.26.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.25.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.24.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.22.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.21.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.20.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.19.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.18.pre spec/factories/cmor/carousels/item_details.rb
cmor_carousels-0.0.17.pre spec/factories/cmor/carousels/item_details.rb