Sha256: c15f3701c874d9e923f083e1ef7cbe4632d1691b606c7f0675dd61a9210c584d

Contents?: true

Size: 869 Bytes

Versions: 1

Compression:

Stored size: 869 Bytes

Contents

require 'spec_helper'

module Spotlight
  describe "shared/_exhibit_masthead", :type => :view 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
      allow(view).to receive_messages(current_exhibit: current_exhibit)
      render
      expect(rendered).to have_selector('.site-title', text: "Some title")
      expect(rendered).to have_selector('.site-title small', text: "Subtitle")
    end

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

Version data entries

1 entries across 1 versions & 1 rubygems

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