Sha256: 992df1fa4568f6912dd17bf6c49c0232c9a7e2e2b43518eb192017ff10e62998

Contents?: true

Size: 695 Bytes

Versions: 6

Compression:

Stored size: 695 Bytes

Contents

require 'spec_helper'

describe WorthwhileHelper do
  describe "render_constraints_query" do
    before do
      # Stub methods from Blacklight::SearchFields
      allow(helper).to receive(:default_search_field).and_return(CatalogController.blacklight_config.default_search_field)
      allow(helper).to receive(:label_for_search_field).and_return("Foo")
    end

    let(:search_params) { { q: 'Simon', search_field: 'publisher', controller: 'catalog' } }
    subject { helper.render_constraints_query(search_params) }

    it "removes search_field" do
      node = Capybara::Node::Simple.new(subject)
      expect(node).to have_link 'Remove constraint Foo: Simon', href: '/'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
worthwhile-0.1.2 spec/helpers/render_constraints_helper_spec.rb
worthwhile-0.1.1 spec/helpers/render_constraints_helper_spec.rb
worthwhile-0.1.0 spec/helpers/render_constraints_helper_spec.rb
worthwhile-0.0.3 spec/helpers/render_constraints_helper_spec.rb
worthwhile-0.0.2 spec/helpers/render_constraints_helper_spec.rb
worthwhile-0.0.1 spec/helpers/render_constraints_helper_spec.rb