Sha256: 265bedb03533745fb23c98ecb948c2e5d2201df73deb19a75d287002fca533c0
Contents?: true
Size: 1.22 KB
Versions: 8
Compression:
Stored size: 1.22 KB
Contents
require 'spec_helper' describe "catalog/constraints" do let :blacklight_config do Blacklight::Configuration.new do |config| config.view.xyz end end it "should render nothing if no constraints are set" do view.stub(query_has_constraints?: false) render partial: "catalog/constraints" expect(rendered).to be_empty end it "should render a start over link" do view.should_receive(:search_action_path).with({}).and_return('http://xyz') view.stub(query_has_constraints?: true) view.stub(:blacklight_config).and_return(blacklight_config) render partial: "catalog/constraints" expect(rendered).to have_selector("#startOverLink") expect(rendered).to have_link("Start Over", :href => 'http://xyz') end it "should render a start over link with the current view type" do view.should_receive(:search_action_path).with(view: :xyz).and_return('http://xyz?view=xyz') view.stub(query_has_constraints?: true) params[:view] = 'xyz' view.stub(:blacklight_config).and_return(blacklight_config) render partial: "catalog/constraints" expect(rendered).to have_selector("#startOverLink") expect(rendered).to have_link("Start Over", :href => 'http://xyz?view=xyz') end end
Version data entries
8 entries across 8 versions & 1 rubygems