Sha256: b19c082e4611300d8ae1c56399fb6d2e3edda1460f72cbca7e67f015b85a7c38

Contents?: true

Size: 773 Bytes

Versions: 2

Compression:

Stored size: 773 Bytes

Contents

require 'spec_helper'

module Spotlight
  describe "shared/_exhibit_masthead" do
    let(:current_exhibit) { double(title: "Some title", subtitle: "Subtitle") }
    let(:current_exhibit_without_subtitle) { double(title: "Some title", subtitle: nil) }
  
    it "should display the title and subtitle" do
      view.stub(current_exhibit: current_exhibit)
      render
      expect(rendered).to have_selector('h1', text: "Some title")
      expect(rendered).to have_selector('h1 small', text: "Subtitle")
    end

    it "should display just the title" do
      view.stub(current_exhibit: current_exhibit_without_subtitle)
      render
      expect(rendered).to have_selector('h1', text: "Some title")
      expect(rendered).to_not have_selector('h1 small')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
blacklight-spotlight-0.0.2 spec/views/shared/_exhibit_masthead.html.erb_spec.rb
blacklight-spotlight-0.0.1 spec/views/shared/_exhibit_masthead.html.erb_spec.rb