Sha256: 688c4fda4e8ab9699349a5f9ee04a5b9c7b60aecca7ced17e483c457d8ac1a92

Contents?: true

Size: 965 Bytes

Versions: 32

Compression:

Stored size: 965 Bytes

Contents

describe 'spotlight/exhibits/_exhibit_card_front.html.erb', type: :view do
  let(:exhibit) { FactoryGirl.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

32 entries across 32 versions & 1 rubygems

Version Path
blacklight-spotlight-1.0.0 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-1.0.0.alpha2 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-1.0.0.alpha1 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.34.1 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.34.0 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.33.3 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.33.2 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.33.1 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.33.0 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.32.0 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.31.0 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.30.0 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.29.1 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.29.0 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.28.3 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.28.2 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.28.1 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.28.0 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.27.0 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.26.1 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb