Sha256: 8201fc9233539632f189cb9690c637000548d5f4d89eeed198f422bf49f307f8

Contents?: true

Size: 1.07 KB

Versions: 40

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

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 'disables the update button' do
      assign(:searches, [])
      expect(exhibit).to receive(:searchable?).and_return(true)
      render
      expect(rendered).to have_content 'You can save search results'
    end
  end

  describe 'When the exhibit is not searchable' do
    it 'displays 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, \
temporarily turn on the Display search box option in the Options section \
of the Configuration > Search page.)
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
blacklight-spotlight-3.4.0 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.3.0 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.2.0 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.1.0 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.0.3 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.0.2 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.0.1 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.0.0 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc6 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc5 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc4 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc3 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc2 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc1 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.10 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.9 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.8 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.7 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.6 spec/views/spotlight/searches/index.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.5 spec/views/spotlight/searches/index.html.erb_spec.rb