File tree Expand file tree Collapse file tree 4 files changed +36
-5
lines changed Expand file tree Collapse file tree 4 files changed +36
-5
lines changed Original file line number Diff line number Diff line change 1+ <%= render 'did_you_mean' %>
2+
3+ <%= render 'constraints' %>
4+
5+ <%= render 'sort_and_per_page' %>
Original file line number Diff line number Diff line change 1616
1717 <% extra_head_content << render_opensearch_response_metadata . html_safe %>
1818
19- <%= render 'did_you_mean' %>
20-
21- <%= render 'constraints' %>
22-
23- <%= render 'sort_and_per_page' %>
19+ <%= render 'search_header' %>
2420
2521 < h2 class ="hide-text "> <%= t ( 'blacklight.search.search_results' ) %> </ h2 >
2622
Original file line number Diff line number Diff line change 1+ # -*- encoding : utf-8 -*-
2+ require File . expand_path ( File . dirname ( __FILE__ ) + '/../../spec_helper' )
3+
4+ # spec for sidebar partial in catalog show view
5+
6+ describe "/catalog/_search_header.html.erb" do
7+
8+ it "should render the default search header partials" do
9+ stub_template "_did_you_mean.html.erb" => "did_you_mean"
10+ stub_template "_constraints.html.erb" => "constraints"
11+ stub_template "_sort_and_per_page.html.erb" => "sort_and_per_page"
12+ render
13+ expect ( rendered ) . to match /did_you_mean/
14+ expect ( rendered ) . to match /constraints/
15+ expect ( rendered ) . to match /sort_and_per_page/
16+ end
17+ end
Original file line number Diff line number Diff line change 1515 render
1616 expect ( rendered ) . to match /sidebar_content/
1717 end
18+
19+ it "should render the search_header partial " do
20+ stub_template "catalog/_results_pagination.html.erb" => ""
21+ stub_template "catalog/_search_header.html.erb" => "header_content"
22+
23+ view . stub ( :blacklight_config ) . and_return ( Blacklight ::Configuration . new )
24+ view . stub ( :has_search_parameters? ) . and_return ( true )
25+ view . stub ( :extra_head_content ) . and_return ( [ ] )
26+ view . stub ( :render_opensearch_response_metadata ) . and_return ( "" )
27+ view . stub ( :response_has_no_search_results? ) . and_return ( true )
28+ render
29+ expect ( rendered ) . to match /header_content/
30+ end
1831end
You can’t perform that action at this time.
0 commit comments