Sha256: ae6031bc9dcbd7e34425aa4fcba4c1b31e3fd2bcaf7c84313d486c36430c4b39

Contents?: true

Size: 657 Bytes

Versions: 56

Compression:

Stored size: 657 Bytes

Contents

FactoryBot.define do
  factory :cmor_galleries_picture_detail, class: 'Cmor::Galleries::PictureDetail' do
    association :picture_gallery, factory: :cmor_galleries_picture_gallery
    after(:build) { |resource|
      assets = resource.picture_gallery.assets.attach(
        io:           File.open(File.join(Cmor::Galleries::Engine.root.join(*%w( spec files cmor galleries picture_details example.png)))),
        filename:     'example.png',
        content_type: 'image/png'
      )
      if Rails.version < "6.0.0"
        resource.asset = assets.first
      else
        resource.asset = resource.picture_gallery.assets.first
      end
    }
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
cmor_galleries-0.0.60.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.59.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.58.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.57.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.56.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.55.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.54.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.53.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.51.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.50.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.49.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.48.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.45.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.44.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.43.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.42.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.41.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.40.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.39.pre spec/factories/cmor_galleries_picture_details.rb
cmor_galleries-0.0.38.pre spec/factories/cmor_galleries_picture_details.rb