Sha256: a80b67114c7d94e87b8b355a2c1ede0b3615b8451e96309568194f43faaedd08

Contents?: true

Size: 1.54 KB

Versions: 19

Compression:

Stored size: 1.54 KB

Contents

require 'spec_helper'

module Spotlight
  describe 'spotlight/catalog/admin.html.erb', type: :view do
    let(:exhibit) { stub_model(Spotlight::Exhibit) }
    before do
      allow(view).to receive(:blacklight_config).and_return(CatalogController.blacklight_config)
      allow(view).to receive(:spotlight_page_path_for).and_return(nil)
      allow(view).to receive(:current_exhibit).and_return(exhibit)
      allow(view).to receive(:new_exhibit_catalog_path).and_return('')
      allow(view).to receive(:new_exhibit_resources_upload_path).and_return('')
      allow(view).to receive(:reindex_all_exhibit_resources_path).and_return('')
      assign(:exhibit, exhibit)
      assign(:response, [])
      stub_template '_search_header.html.erb' => 'header'
      stub_template '_zero_results.html.erb' => 'nuffin'
      stub_template '_results_pagination.html.erb' => '0'
      allow(view).to receive(:can?).and_return(true)
    end
    it 'renders the sidebar' do
      render
      expect(rendered).to have_link 'Browse'
    end

    it "does not render the 'add repository item' link if no repository sources are configured" do
      allow(Spotlight::Engine.config).to receive(:new_resource_partials).and_return([])
      render
      expect(rendered).to_not have_link 'Add repository item'
    end

    it "does not render the 'add repository item' link if no repository sources are configured" do
      allow(Spotlight::Engine.config).to receive(:new_resource_partials).and_return(['a'])
      render
      expect(rendered).to have_link 'Add repository item'
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
blacklight-spotlight-0.13.0 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.12.1 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.12.0 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.11.0 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.10.3 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.10.2 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.10.1 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.10.0 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.9.2 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.9.1 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.9.0 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.8.2 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.8.1 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.8.0 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.7.2 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.7.1 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.7.0 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.6.0 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.5.0 spec/views/spotlight/catalog/admin.html.erb_spec.rb