-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #199 from scientist-softserv/setting-version-befor…
…e-super Ensuring version is set earlier in instantiation
- Loading branch information
Showing
4 changed files
with
44 additions
and
3 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
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
20 changes: 20 additions & 0 deletions
20
spec/services/iiif_print/manifest_builder_service_behavior_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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
require 'spec_helper' | ||
|
||
RSpec.describe IiifPrint::ManifestBuilderServiceBehavior do | ||
context '#initialize' do | ||
it 'uses defaults to set the version' do | ||
builder_service = Hyrax::ManifestBuilderService.new | ||
expect(builder_service.manifest_factory).to eq(::IIIFManifest::ManifestFactory) | ||
expect(builder_service.version).to eq(IiifPrint.config.default_iiif_manifest_version) | ||
end | ||
|
||
it 'allows version overrides' do | ||
# This in part verifies the expected interaction of the version as a parameter being picked up | ||
# by another parameter. | ||
builder_service = Hyrax::ManifestBuilderService.new(version: 3) | ||
expect(builder_service.manifest_factory).to eq(::IIIFManifest::V3::ManifestFactory) | ||
expect(builder_service.version).to eq(3) | ||
end | ||
end | ||
end |