Sha256: 2df03aafcff3dd6d49a82341071cf8d369f505d28f27d307c349bb7440d1a9f1

Contents?: true

Size: 1.26 KB

Versions: 46

Compression:

Stored size: 1.26 KB

Contents

require 'spec_helper'

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 "should render the sidebar and content panes" do
      render
      expect(rendered).to match /id="sidebar"/
      expect(rendered).to match /id="content"/
    end

    it "should render 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, double(:empty? => true))
    end
    it "should render the search_header partial " do
      render
      expect(rendered).to match /header_content/
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
blacklight-5.19.2 spec/views/catalog/index.html.erb_spec.rb
blacklight-5.19.1 spec/views/catalog/index.html.erb_spec.rb
blacklight-5.19.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-5.18.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-5.17.2 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.0.0.pre5 spec/views/catalog/index.html.erb_spec.rb
blacklight-5.17.1 spec/views/catalog/index.html.erb_spec.rb
blacklight-5.17.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.0.0.pre4 spec/views/catalog/index.html.erb_spec.rb
blacklight-5.16.4 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.0.0.pre3 spec/views/catalog/index.html.erb_spec.rb
blacklight-5.16.3 spec/views/catalog/index.html.erb_spec.rb
blacklight-5.16.2 spec/views/catalog/index.html.erb_spec.rb
blacklight-5.16.1 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.0.0.pre2 spec/views/catalog/index.html.erb_spec.rb
blacklight-6.0.0.pre1 spec/views/catalog/index.html.erb_spec.rb
blacklight-5.16.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-5.15.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-5.14.0 spec/views/catalog/index.html.erb_spec.rb
blacklight-5.13.1 spec/views/catalog/index.html.erb_spec.rb