Sha256: 577c6116213253b519f80a212cc6189dc2689a3d8f79025179b1460a6c8bb777

Contents?: true

Size: 1.51 KB

Versions: 47

Compression:

Stored size: 1.51 KB

Contents

describe 'spotlight/catalog/admin.html.erb', type: :view do
  let(:exhibit) { stub_model(Spotlight::Exhibit) }
  let(:blacklight_config) { CatalogController.blacklight_config }
  before do
    allow(view).to receive(:blacklight_config).and_return(blacklight_config)
    allow(exhibit).to receive(:blacklight_config).and_return(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_resource_path).and_return('')
    allow(view).to receive(:reindex_all_exhibit_resources_path).and_return('')
    allow(view).to receive(:monitor_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 "renders the 'add items' link if any repository sources are configured" do
    allow(Spotlight::Engine.config).to receive(:resource_partials).and_return(['a'])
    render
    expect(rendered).to have_link 'Add items'
  end

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

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
blacklight-spotlight-2.0.2 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-2.0.1 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-2.0.0 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc6 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc5 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc4 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc3 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc2 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc1 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-1.5.1 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-1.4.1 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-1.4.0 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-1.3.0 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-1.2.0 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-1.1.0 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-1.0.0 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-1.0.0.alpha2 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-1.0.0.alpha1 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.34.1 spec/views/spotlight/catalog/admin.html.erb_spec.rb
blacklight-spotlight-0.34.0 spec/views/spotlight/catalog/admin.html.erb_spec.rb