Sha256: f3c96cbd897926ef56ec6256ded1ee0e31ae02babf0bca64b72a0e874119195e
Contents?: true
Size: 1.98 KB
Versions: 6
Compression:
Stored size: 1.98 KB
Contents
require 'spec_helper' describe "catalog/_facets" do before do @mock_config = Blacklight::Configuration.new view.stub(:blacklight_config => @mock_config) end it "should not have a header if no facets are displayed" do view.stub(:render_facet_partials => '') render expect(rendered).to_not have_selector('h4') end it "should have a header" do @mock_field_1 = double(:field => 'facet_field_1', :label => 'label') @mock_display_facet_1 = double(:name => 'facet_field_1', :items => [Blacklight::SolrResponse::Facets::FacetItem.new(:value => 'Value', :hits => 1234)]) view.stub(:facet_field_names => [:facet_field_1], :facet_limit_for => 10 ) @response = double() @response.stub(:facet_by_field_name).with(:facet_field_1) { @mock_display_facet_1 } view.stub(:render_facet_partials => '') render expect(rendered).to have_selector('h4') end describe "facet display" do before do @mock_field_1 = double(:field => 'facet_field_1', :label => 'label') @mock_display_facet_1 = double(:name => 'facet_field_1', :items => [Blacklight::SolrResponse::Facets::FacetItem.new(:value => 'Value', :hits => 1234)]) view.stub(:facet_field_names => [:facet_field_1], :facet_limit_for => 10 ) @response = double() @response.stub(:facet_by_field_name).with(:facet_field_1) { @mock_display_facet_1 } end it "should have a(n accessible) header" do render expect(rendered).to have_selector('h5') end it "should list values" do render # The .facet-content class is used by blacklight_range_limit js, and # should be applied to the .panel-collapse div that contains the collapsible # facet content. Please make sure it remains if possible. expect(rendered).to have_selector('.facet-content a.facet_select') expect(rendered).to have_selector('.facet-content .facet-count') end end end
Version data entries
6 entries across 6 versions & 1 rubygems