Sha256: 2e30cfc0a9f18aef0fe338f7c40b1803d7fc7382acaee8e7f012d11f80ad9206

Contents?: true

Size: 987 Bytes

Versions: 6

Compression:

Stored size: 987 Bytes

Contents

require 'spec_helper'

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

6 entries across 6 versions & 1 rubygems

Version Path
blacklight-spotlight-0.19.0 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.18.0 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.17.1 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.17.0 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.16.0 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb
blacklight-spotlight-0.15.0 spec/views/spotlight/exhibits/_exhibit_card_front.html.erb_spec.rb