-
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 #1209 from sul-dlss/description-type
Use displayLabel and description[@type] when creating IIIF metadata
- Loading branch information
Showing
3 changed files
with
60 additions
and
32 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 |
---|---|---|
|
@@ -11,9 +11,7 @@ | |
<dc:type>Policy brief</dc:type> | ||
<dc:type>Text</dc:type> | ||
<dc:description>This is the abstract field</dc:description> | ||
<dc:description type="preferred citation"> | ||
Author, F. (2025). H2 title field. Version 1. Stanford Digital Repository. Available at https://sul-purl-stage.stanford.edu/zw438wf4318/version/1. https://doi.org/10.80343/zw438wf4318. | ||
</dc:description> | ||
<dc:description type="preferred citation">This is the citation</dc:description> | ||
<dc:subject>keyword</dc:subject> | ||
<dc:date>2025-02-20</dc:date> | ||
<dc:date>2024-04-05</dc:date> | ||
|
@@ -36,10 +34,24 @@ | |
describe '#write' do | ||
subject(:metadata) { metadata_writer.write } | ||
|
||
context 'with relation type="url"' do | ||
context 'with relation[@type="url"]' do | ||
it 'filters out the url value' do | ||
expect(metadata.find { it['label'][:en] == ['Relation'] }['value'][:en]).to eq ['viewer testing'] | ||
end | ||
end | ||
|
||
context 'with description[@displayLabel]' do | ||
it 'filters uses the displayLabel value' do | ||
expect(metadata.find { it['label'][:en] == ['Description'] }['value'][:en]).not_to include '[email protected]' | ||
expect(metadata.find { it['label'][:en] == ['Contact'] }['value'][:en]).to eq ['[email protected]'] | ||
end | ||
end | ||
|
||
context 'with description[@type]' do | ||
it 'filters uses the type value' do | ||
expect(metadata.find { it['label'][:en] == ['Description'] }['value'][:en]).not_to include 'This is the citation' | ||
expect(metadata.find { it['label'][:en] == ['Preferred citation'] }['value'][:en]).to eq ['This is the citation'] | ||
end | ||
end | ||
end | ||
end |
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