Sha256: ed669f7221e21bc3f266ffca579c1361e461403dbad70b7b3a8ea87b93c09b98

Contents?: true

Size: 1.03 KB

Versions: 20

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

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

  before do
    allow(view).to receive_messages(exhibit_path: '/')
  end

  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 '.badge.unpublished', text: 'Unpublished'
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
blacklight-spotlight-3.4.0 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.3.0 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.2.0 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.1.0 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.0.3 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.0.2 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.0.1 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.0.0 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc6 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc5 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc4 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc3 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc2 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc1 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.10 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.9 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.8 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.7 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.6 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.5 spec/views/spotlight/exhibits/_exhibit_card.html.erb_spec.rb