Skip to content

Commit

Permalink
Merge pull request #778 from projectblacklight/simplify_view_spec
Browse files Browse the repository at this point in the history
Simplify the view spec
  • Loading branch information
cbeer committed Feb 13, 2014
2 parents 006be98 + 73dbeb9 commit 227589b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions spec/views/catalog/show.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
before :each do
view.stub(:has_user_authentication_provider? => false)
view.stub(:render_document_sidebar_partial => "Sidebar")
assign :document, document
view.stub(:blacklight_config).and_return(blacklight_config)
end

it "should include schema.org itemscope/type properties" do
view.stub(:document_show_html_title).and_return("Heading")
document.stub(:itemtype => 'some-item-type-uri')
assign :document, document
view.stub(:blacklight_config).and_return(blacklight_config)
render

expect(rendered).to have_selector('div#document[@itemscope]')
Expand All @@ -28,11 +28,9 @@

it "should render the show_header and show partials by default" do
view.stub(:render_grouped_response?).and_return(false)
view.stub(:blacklight_config).and_return(blacklight_config)
stub_template "catalog/_show_header_default.html.erb" => "document_header"
stub_template "catalog/_show_default.html.erb" => "show_default"

assign :document, document
render

expect(rendered).to match /document_header/
Expand All @@ -42,15 +40,13 @@

it "should use the show.partials parameter to determine the partials to render" do
view.stub(:render_grouped_response?).and_return(false)
view.stub(:blacklight_config).and_return(blacklight_config)
blacklight_config.show.partials = ['a', 'b', 'c']
stub_template "catalog/_a_default.html.erb" => "a_partial"
stub_template "catalog/_b_default.html.erb" => "b_partial"
stub_template "catalog/_c_default.html.erb" => "c_partial"
assign :document, document
render
expect(rendered).to match /a_partial/
expect(rendered).to match /b_partial/
expect(rendered).to match /c_partial/
end
end
end

0 comments on commit 227589b

Please sign in to comment.