-
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.
☑️ Add test to clarify expected configuration
With Knapsack, we're noticing that load path issues can be a subtle problem. With this commit, I'm testing the configuration to ensure that we have the expected and correct lamba for generating IIIF Page's file titles. Related to: - https://github.com/scientist-softserv/adventist-dl/issues/628
- Loading branch information
Showing
3 changed files
with
51 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
RSpec.describe IiifPrint do | ||
describe '.config' do | ||
describe '.unique_child_title_generator_function' do | ||
subject { described_class.config.unique_child_title_generator_function } | ||
|
||
it 'is defined in HykuKnapsack::Engine' do | ||
# Verifying that we're using the configured title generator for PDFs. | ||
# Triage for: https://github.com/scientist-softserv/adventist-dl/issues/628 | ||
expect(subject.source_location[0]).to( | ||
eq(HykuKnapsack::Engine.root.join('config', 'initializers', 'iiif_print.rb').to_s) | ||
) | ||
end | ||
end | ||
describe '.sort_iiif_manifest_canvases_by' do | ||
it do | ||
# require 'byebug'; byebug | ||
end | ||
end | ||
end | ||
|
||
describe 'decoration of Hyrax::ManifestBuilderService' do | ||
describe '#manifest_for method' do | ||
subject { Hyrax::ManifestBuilderService.instance_method(:manifest_for).source_location[0] } | ||
|
||
# Verifying that we're using the IIIF Print provided source_location; in particular we're not | ||
# using the undecorated Hyrax version. | ||
it { is_expected.to start_with(IiifPrint::Engine.root.to_s) } | ||
end | ||
|
||
describe '#build_manifest' do | ||
subject { Hyrax::ManifestBuilderService.instance_method(:build_manifest).source_location[0] } | ||
|
||
it do | ||
is_expected.to( | ||
eq(HykuKnapsack::Engine.root.join('app', 'services', 'iiif_print', 'manifest_builder_service_behavior_decorator.rb').to_s) | ||
) | ||
end | ||
end | ||
end | ||
end |