Sha256: 3fbe0b00949e5d2ec2d8bbf5464d97017aeb3df6e85da58da07b42597a2495c0

Contents?: true

Size: 850 Bytes

Versions: 47

Compression:

Stored size: 850 Bytes

Contents

require 'rails_helper'

RSpec.describe Cmor::Carousels::Carousel, type: :model do
  describe '#append_assets' do
    let(:original_assets) { [{ io: File.open(Cmor::Carousels::Engine.root.join(*%w(spec files cmor carousels item_details example.png))), filename: 'original.png' }] }
    let(:appended_assets) { [{ io: File.open(Cmor::Carousels::Engine.root.join(*%w(spec files cmor carousels item_details example.png))), filename: 'appended.png' }] }

    subject { create(:cmor_carousels_carousel) }

    before(:each) do
      subject.assets.attach(original_assets)
      subject.save!
      subject.append_assets = appended_assets
      subject.save!
    end
    it { expect(subject.assets.count).to eq(2) }
    it { expect(subject.item_details.count).to eq(2) }
    it { subject.item_details.each { |id| expect(id.asset).to be_present } }
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
cmor_carousels-0.0.29.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.28.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.27.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.26.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.25.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.24.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.22.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.21.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.20.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.19.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.18.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.17.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.15.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.14.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.13.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.12.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.11.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.10.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.9.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.8.pre spec/models/cmor/carousels/carousel_spec.rb