Sha256: 3684551fc733d4d173a7ab7da2c76fb9414129c5aa95de6cf215beb184db000e

Contents?: true

Size: 1.02 KB

Versions: 32

Compression:

Stored size: 1.02 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe RenderConstraintsHelper do

  before do
    # the helper methods below infer paths from the current route
    controller.request.path_parameters["controller"] = 'catalog'
  end

  describe '#render_constraints_query' do
    it "should have a link relative to the current url" do
      helper.render_constraints_query(:q=>'foobar', :f=>{:type=>'journal'}).should have_selector "a[href='/?f%5Btype%5D=journal']"
    end
  end

  describe '#render_filter_element' do
    before do
      @config = Blacklight::Configuration.new do |config|
        config.add_facet_field 'type'
      end
      helper.stub(:blacklight_config => @config)
    end
    it "should have a link relative to the current url" do
      result = helper.render_filter_element('type', ['journal'], {:q=>'biz'})
      result.size.should == 1
      # I'm not certain how the ampersand gets in there. It's not important.
      result.first.should have_selector "a[href='/?&q=biz']"
    end
  end

end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
blacklight-4.7.0 spec/helpers/render_constraints_helper_spec.rb
blacklight-4.7.0.pre1 spec/helpers/render_constraints_helper_spec.rb
blacklight-4.6.3 spec/helpers/render_constraints_helper_spec.rb
blacklight-4.6.2 spec/helpers/render_constraints_helper_spec.rb
blacklight-4.6.1 spec/helpers/render_constraints_helper_spec.rb
blacklight-4.6.0 spec/helpers/render_constraints_helper_spec.rb
blacklight-4.5.0 spec/helpers/render_constraints_helper_spec.rb
blacklight-4.5.0.rc1 spec/helpers/render_constraints_helper_spec.rb
blacklight-4.4.2 spec/helpers/render_constraints_helper_spec.rb
blacklight-4.4.1 spec/helpers/render_constraints_helper_spec.rb
blacklight-4.4.0 spec/helpers/render_constraints_helper_spec.rb
blacklight-4.3.0 spec/helpers/render_constraints_helper_spec.rb
blacklight-4.2.2 spec/helpers/render_constraints_helper_spec.rb
blacklight-4.2.1 spec/helpers/render_constraints_helper_spec.rb
blacklight-4.2.0 spec/helpers/render_constraints_helper_spec.rb
blacklight-4.1.0 test_support/spec/helpers/render_constraints_helper_spec.rb
blacklight-4.0.1 test_support/spec/helpers/render_constraints_helper_spec.rb
blacklight-3.8.2 test_support/spec/helpers/render_constraints_helper_spec.rb
blacklight-4.0.0 test_support/spec/helpers/render_constraints_helper_spec.rb
blacklight-4.0.0.rc2 test_support/spec/helpers/render_constraints_helper_spec.rb