Sha256: 2059a31400247ca5ae56ca2df569224b842c79947b9d1791ae652d0e4bafc882

Contents?: true

Size: 1003 Bytes

Versions: 24

Compression:

Stored size: 1003 Bytes

Contents

describe Spotlight::Masthead, type: :model do
  describe '#masthead_exists?' do
    let(:masthead) { stub_model(described_class) }
    let(:image) { OpenStruct.new }
    it 'returns false when the masthead is set to not display' do
      expect(masthead.display?).to be_falsey
    end
    it 'returns false when the cropped image is not present' do
      masthead.display = true
      expect(masthead.display?).to be_falsey
    end
    it 'returns false when the cropped image is present but the masthead is set to not display' do
      allow(masthead).to receive(:image).and_return(image)
      allow(image).to receive(:cropped).and_return([0])
      expect(masthead.display?).to be_falsey
    end
    it 'returns true when the cropped image is present and the masthead is set to display' do
      masthead.display = true
      expect(masthead).to receive(:image).and_return(image)
      expect(image).to receive(:cropped).and_return([0])
      expect(masthead.display?).to be_truthy
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
blacklight-spotlight-0.32.0 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.31.0 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.30.0 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.29.1 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.29.0 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.28.3 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.28.2 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.28.1 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.28.0 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.27.0 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.26.1 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.26.0 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.25.0 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.24.0 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.23.0 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.22.0 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.21.0 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.20.3 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.20.2 spec/models/spotlight/masthead_spec.rb
blacklight-spotlight-0.20.1 spec/models/spotlight/masthead_spec.rb