Sha256: a72eef0553959a65989d80253253c2efc93ceeb82fb0cb39cdc7d070fd05abdf

Contents?: true

Size: 963 Bytes

Versions: 9

Compression:

Stored size: 963 Bytes

Contents

describe 'spotlight/exhibits/_exhibit_card_front.html.erb', type: :view do
  let(:exhibit) { FactoryBot.create(:exhibit) }
  let(:p) { 'spotlight/exhibits/exhibit_card_front' }

  context 'for an exhibit without a thumbnail' do
    before do
      exhibit.update(thumbnail_id: nil)
    end

    it 'has a placeholder thumbnail' do
      render p, exhibit: exhibit

      expect(rendered).to have_selector 'img.default-thumbnail'
    end
  end

  it 'has a thumbnail' do
    render p, exhibit: exhibit

    expect(rendered).to have_selector 'img'
  end

  it 'has a title' do
    render p, exhibit: exhibit

    expect(rendered).to have_selector '.card-title', text: exhibit.title
  end

  context 'for an unpublished exhibit' do
    before do
      exhibit.update(published: false)
    end

    it 'has an unpublished banner' do
      render p, exhibit: exhibit

      expect(rendered).to have_selector '.label.unpublished', text: 'Unpublished'
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
blacklight-spotlight-2.4.1 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-2.4.0 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-2.3.3 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-2.3.2 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-2.3.1 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-2.3.0 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-2.2.1 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-2.2.0 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-2.1.0 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb