Skip to content

Commit

Permalink
Add class on documents container for the current view type
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Mar 11, 2015
1 parent 881c06d commit c1db92e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/views/catalog/_document_list.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% # container for all documents in index view -%>
<div id="documents">
<% # container for all documents in index list view -%>
<div id="documents" class="documents-<%= document_index_view_type %>">
<%= render documents, :as => :document %>
</div>
11 changes: 8 additions & 3 deletions spec/views/catalog/_document_list.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
require 'spec_helper'

describe "/catalog/_document_list.html.erb" do


describe "catalog/_document_list", type: :view do

before do
allow(view).to receive_messages(document_index_view_type: "some-view", documents: [])
end

it "should include a class for the current view" do
render
expect(rendered).to have_selector(".documents-some-view")
end
end

0 comments on commit c1db92e

Please sign in to comment.