Sha256: 0493c9946085aba6d3affd8900b74c09899fb631671c43815ae30452b4b3ea07
Contents?: true
Size: 575 Bytes
Versions: 43
Compression:
Stored size: 575 Bytes
Contents
FactoryBot.define do factory :cmor_blog_asset_detail, class: Cmor::Blog::AssetDetail do association(:post, factory: :cmor_blog_post) after(:build) { |resource| assets = resource.post.assets.attach( io: File.open(File.join(Cmor::Blog::Engine.root.join(*%w( spec files cmor blog asset example.jpg)))), filename: 'example.jpg', content_type: 'image/jpeg' ) if Rails.version < "6.0.0" resource.asset = assets.first else resource.asset = resource.post.assets.first end } end end
Version data entries
43 entries across 43 versions & 1 rubygems