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.51.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.50.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.49.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.48.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.45.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.44.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.43.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.42.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.41.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.40.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.39.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.38.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.37.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.36.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.35.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.34.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.33.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.32.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.31.pre spec/models/cmor/carousels/carousel_spec.rb
cmor_carousels-0.0.30.pre spec/models/cmor/carousels/carousel_spec.rb