Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.

Commit

Permalink
Add multi-part viewing hint to MVW.
Browse files Browse the repository at this point in the history
Closes #340
  • Loading branch information
Trey Terrell committed Jan 12, 2016
1 parent 9b256d7 commit 59041ea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/presenters/multi_volume_work_show_presenter.rb
Expand Up @@ -2,4 +2,8 @@ class MultiVolumeWorkShowPresenter < CurationConcernsShowPresenter
def file_presenter_class
::ScannedResourceShowPresenter
end

def viewing_hint
'multi-part'
end
end
4 changes: 3 additions & 1 deletion spec/presenters/collection_show_presenter_spec.rb
Expand Up @@ -37,7 +37,9 @@
end

it "can be used to create a manifest" do
expect { ManifestBuilder.new(subject).to_json }.not_to raise_error
manifest = nil
expect { manifest = ManifestBuilder.new(subject).to_json }.not_to raise_error
expect(JSON.parse(manifest)['viewingHint']).not_to eq "multi-part"
end

describe "#label" do
Expand Down
1 change: 1 addition & 0 deletions spec/services/manifest_builder_spec.rb
Expand Up @@ -25,6 +25,7 @@
it "renders as a collection" do
expect(manifest['@type']).to eq "sc:Collection"
expect(manifest['@id']).to eq "http://plum.com/concern/multi_volume_works/2/manifest"
expect(manifest['viewingHint']).to eq "multi-part"
end
it "renders a manifest for every child scanned resource" do
expect(subject.manifests.length).to eq 1
Expand Down

0 comments on commit 59041ea

Please sign in to comment.