Sha256: 8c32381625821c40c2003c931e973e8dc9afa67734f9f7fc5274cece4d7a07e5

Contents?: true

Size: 1.28 KB

Versions: 31

Compression:

Stored size: 1.28 KB

Contents

# frozen_string_literal: true

describe "catalog/index.html.erb" do

  describe "with no search parameters" do
    before do
      allow(view).to receive(:has_search_parameters?).and_return(false)
      allow(view).to receive(:blacklight_config).and_return(Blacklight::Configuration.new)
    end
    it "renders the sidebar and content panes" do
      render
      expect(rendered).to match /id="sidebar"/
      expect(rendered).to match /id="content"/
    end
    it "renders the search_sidebar partial" do
      stub_template "catalog/_search_sidebar.html.erb" => "sidebar_content"
      render
      expect(rendered).to match /sidebar_content/
    end
  end

  describe "with search parameters" do
    before do
      allow(view).to receive(:has_search_parameters?).and_return(true)
      stub_template "catalog/_results_pagination.html.erb" => ""
      stub_template "catalog/_search_header.html.erb" => "header_content"
      allow(view).to receive(:blacklight_config).and_return(Blacklight::Configuration.new)
      allow(view).to receive(:render_opensearch_response_metadata).and_return("")
      assign(:response, instance_double(Blacklight::Solr::Response, empty?: true))
    end
    it "renders the search_header partial" do
      render
      expect(rendered).to match /header_content/
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
blacklight-6.25.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.24.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.23.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.22.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.21.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.20.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.19.2 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.19.1 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.19.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.18.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.17.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.16.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.15.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.14.1 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.14.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.13.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.12.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.11.2 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.11.1 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.11.0 spec/views/catalog/index.html.erb_spec.rb