Sha256: ef68c55cc92cba17fbce68e08db971d08026b147d9f29e6231866d2ff10c3944

Contents?: true

Size: 1.21 KB

Versions: 39

Compression:

Stored size: 1.21 KB

Contents

# frozen_string_literal: true

RSpec.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

    let(:sidebar) { view.content_for(:sidebar) }

    it "renders the search_sidebar partial" do
      stub_template "catalog/_search_sidebar.html.erb" => "sidebar_content"
      render
      expect(sidebar).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("")
      @response = instance_double(Blacklight::Solr::Response, empty?: true, total: 11, start: 1, limit_value: 10)
    end

    it "renders the search_header partial" do
      render
      expect(rendered).to match /header_content/
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
blacklight-7.22.2 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.22.1 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.22.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.21.2 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.21.1 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.21.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.20.1 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.20.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.19.2 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.19.1 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.19.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.18.1 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.18.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.17.2 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.17.1 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.17.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.16.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.15.2 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.15.1 spec/views/catalog/index.html.erb_spec.rb
blacklight-7.15.0 spec/views/catalog/index.html.erb_spec.rb