Skip to content

Commit

Permalink
add erb_spec for catalog/_document partial
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Sep 18, 2013
1 parent 0ac54a4 commit a5bf244
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions spec/views/catalog/_document.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require 'spec_helper'

describe "catalog/_document" do
let :document do
SolrDocument.new :id => 'xyz', :format => 'a'
end

let :blacklight_config do
Blacklight::Configuration.new
end

it "should render the header, thumbnail and index" do
view.stub(:blacklight_config).and_return(blacklight_config)
stub_template "catalog/_document_header.html.erb" => "document_header"
stub_template "catalog/_thumbnail_default.html.erb" => "thumbnail_default"
stub_template "catalog/_index_default.html.erb" => "index_default"
render :partial => "catalog/document", :locals => {:document => document, :document_counter => 1}
expect(rendered).to match /document_header/
expect(rendered).to match /thumbnail_default/
expect(rendered).to match /index_default/
end
end

0 comments on commit a5bf244

Please sign in to comment.