-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add class on documents container for the current view type
- Loading branch information
Showing
3 changed files
with
11 additions
and
6 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
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> |
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 |
---|---|---|
@@ -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 |