Sha256: a9d0ca98a1c29994e691d0b5697d5b44e1d88b9081ef0632d5682ba2df59cfa9

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

describe "spotlight/searches/index.html.erb", :type => :view do
  let(:exhibit) { stub_model(Spotlight::Exhibit) }

  before do
    allow(view).to receive_messages(update_all_exhibit_searches_path: "/")
    allow(view).to receive(:current_exhibit).and_return(exhibit)
    assign(:exhibit, exhibit)
  end

  describe "Without searches" do
    it "should disable the update button" do
      assign(:searches, [])
      render
      expect(rendered).to have_content "You can save search results"
    end
  end

  describe 'When the exhibit is not searchable' do
    it 'should display a warning' do
      assign(:searches, [])
      expect(exhibit).to receive(:searchable?).and_return(false)
      render
      expect(rendered).to have_css('.alert-warning', text: "This exhibit is not currently searchable. To perform searches that can be saved as additional browse categories, an Administrator must temporarily turn on the Searchable option in the Exhibit Style section of the Administration > Appearance page.")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blacklight-spotlight-0.2.0 spec/views/spotlight/searches/index.html.erb_spec.rb