Sha256: 014d0e7de7f3e423d2cd53291312d207bed791dbbdee3f4f8e0be9890509b7d6
Contents?: true
Size: 1.2 KB
Versions: 8
Compression:
Stored size: 1.2 KB
Contents
describe BlacklightAdvancedSearch::RenderConstraintsOverride, type: :helper do let(:blacklight_config) do Blacklight::Configuration.new do |config| config.add_facet_field 'type' end end let(:advanced_query) do BlacklightAdvancedSearch::QueryParser.new(params, blacklight_config) end describe "#render_constraints_filters" do before do allow(helper).to receive(:blacklight_config).and_return(blacklight_config) allow(helper).to receive(:advanced_query).and_return(advanced_query) allow(helper).to receive(:search_action_path) do |*args| search_catalog_path(*args) end end subject(:rendered) { helper.render_constraints_filters({}) } context 'with an array of facet params' do let(:params) { ActionController::Parameters.new f_inclusive: { 'type' => ['a'] } } it "renders nothing" do expect(rendered).to have_text 'Remove constraint Type: a' end end context 'with scalar facet limit params' do let(:params) { ActionController::Parameters.new f_inclusive: { 'type' => 'a' } } it "renders the scalar value" do expect(rendered).to have_text 'Remove constraint Type: a' end end end end
Version data entries
8 entries across 8 versions & 1 rubygems