-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow the openseadgragon view to accept more flexible view_config
- Loading branch information
1 parent
4948135
commit 074b2a4
Showing
2 changed files
with
15 additions
and
9 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
21 changes: 13 additions & 8 deletions
21
spec/views/catalog/_openseadragon_default.html.erb_spec.rb
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,22 +1,27 @@ | ||
require 'spec_helper' | ||
|
||
describe "catalog/openseadragon_default" do | ||
describe 'catalog/openseadragon_default' do | ||
let(:document) { SolrDocument.new } | ||
let(:blacklight_config) { Blacklight::Configuration.new } | ||
let(:p) { "catalog/openseadragon_default" } | ||
let(:p) { 'catalog/openseadragon_default' } | ||
|
||
before do | ||
allow(view).to receive_messages(blacklight_config: blacklight_config, openseadragon_picture_tag: "<img />") | ||
allow(document).to receive_messages(to_openseadragon: []) | ||
allow(view).to receive_messages( | ||
blacklight_config: blacklight_config, | ||
documents: [document], | ||
document_index_view_type: 'embed', | ||
openseadragon_picture_tag: '<img />' | ||
) | ||
end | ||
|
||
it "should render the openseadragon container" do | ||
it 'should render the openseadragon container' do | ||
render partial: p, locals: { document: document } | ||
expect(rendered).to have_selector ".openseadragon-container" | ||
expect(rendered).to have_selector '.openseadragon-container' | ||
end | ||
|
||
it "should support passing a container class" do | ||
render partial: p, locals: { document: document, osd_container_class: "custom-container" } | ||
expect(rendered).to have_selector ".custom-container" | ||
it 'should support passing a container class' do | ||
render partial: p, locals: { document: document, osd_container_class: 'custom-container' } | ||
expect(rendered).to have_selector '.custom-container' | ||
end | ||
end |