Sha256: 74a2f8bd50dfed39149a30e90ae4d3e813fa2774d8f754b2197f9b2aac53f875

Contents?: true

Size: 593 Bytes

Versions: 56

Compression:

Stored size: 593 Bytes

Contents

FactoryBot.define do
  factory :cmor_files_file_detail, class: 'Cmor::Files::FileDetail' do
    association :folder, factory: :cmor_files_folder
    after(:build) { |resource| 
      assets = resource.folder.assets.attach(
        io:           File.open(File.join(Cmor::Files::Engine.root.join(*%w( spec files cmor files file_details example.png)))),
        filename:     'example.png',
        content_type: 'image/png'
      )
      if Rails.version < "6.0.0"
        resource.asset = assets.first
      else
        resource.asset = resource.folder.assets.first
      end
    }
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

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