-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #777 from projectblacklight/facet-rendering
Use common facet rendering behavior on facet sidebar and facet action re...
- Loading branch information
Showing
12 changed files
with
109 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
require 'spec_helper' | ||
|
||
describe 'catalog/facet.html.erb' do | ||
let(:display_facet) { double } | ||
let(:blacklight_config) { Blacklight::Configuration.new } | ||
before :each do | ||
blacklight_config.add_facet_field 'xyz', label: "Facet title" | ||
view.stub(:blacklight_config).and_return(blacklight_config) | ||
stub_template 'catalog/_facet_pagination.html.erb' => 'pagination' | ||
assign :facet, blacklight_config.facet_fields['xyz'] | ||
assign :display_facet, display_facet | ||
end | ||
|
||
it "should have the facet title" do | ||
view.stub(:render_facet_limit) | ||
render | ||
expect(rendered).to have_selector 'h3', text: "Facet title" | ||
end | ||
|
||
it "should render facet pagination" do | ||
view.stub(:render_facet_limit) | ||
render | ||
expect(rendered).to have_content 'pagination' | ||
end | ||
|
||
it "should render the facet limit" do | ||
view.should_receive(:render_facet_limit).with(display_facet, layout: false) | ||
render | ||
end | ||
end |