Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove abstract mapping tests not needed in Cocina>MODS direction #460

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
235 changes: 2 additions & 233 deletions spec/cocina/models/mapping/descriptive/mods/abstract_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
end
end

describe 'Abstract with type "summary"' do
describe 'Abstract with type' do
it_behaves_like 'MODS cocina mapping' do
let(:mods) do
<<~XML
Expand All @@ -98,54 +98,6 @@
end
end

describe 'Abstract with type "Summary"' do
it_behaves_like 'MODS cocina mapping' do
let(:mods) do
<<~XML
<abstract type="Summary">This is a summary.</abstract>
XML
end

let(:roundtrip_mods) do
<<~XML
<abstract type="summary">This is a summary.</abstract>
XML
end

let(:cocina) do
{
note: [
{
value: 'This is a summary.',
type: 'summary'
}
]
}
end
end
end

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normalization not needed in Cocina>MODS direction.

describe 'Abstract with type "scope and content"' do
it_behaves_like 'MODS cocina mapping' do
let(:mods) do
<<~XML
<abstract type="scope and content">This is a scope and content note.</abstract>
XML
end

let(:cocina) do
{
note: [
{
value: 'This is a scope and content note.',
type: 'scope and content'
}
]
}
end
end
end

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specific type value does not matter, so this test is duplicative of the one at line 80.

describe 'Abstract with display label and type' do
it_behaves_like 'MODS cocina mapping' do
let(:mods) do
Expand All @@ -168,7 +120,7 @@
end
end

describe 'Abstract with displayLabel "Summary" and no type' do
describe 'Abstract with displayLabel and no type' do
it_behaves_like 'MODS cocina mapping' do
let(:mods) do
<<~XML
Expand All @@ -189,189 +141,6 @@
end
end

describe 'Abstract with displayLabel "Subject" and no type' do
it_behaves_like 'MODS cocina mapping' do
let(:mods) do
<<~XML
<abstract displayLabel="Subject">Subject</abstract>
XML
end

let(:cocina) do
{
note: [
{
value: 'Subject',
displayLabel: 'Subject'
}
]
}
end
end
end

describe 'Abstract with displayLabel "Review" and no type' do
it_behaves_like 'MODS cocina mapping' do
let(:mods) do
<<~XML
<abstract displayLabel="Review">Review</abstract>
XML
end

let(:cocina) do
{
note: [
{
value: 'Review',
displayLabel: 'Review'
}
]
}
end
end
end

describe 'Abstract with displayLabel "Scope and content" and no type' do
it_behaves_like 'MODS cocina mapping' do
let(:mods) do
<<~XML
<abstract displayLabel="Scope and content">Scope and content</abstract>
XML
end

let(:cocina) do
{
note: [
{
value: 'Scope and content',
displayLabel: 'Scope and content'
}
]
}
end
end
end

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests all effectively duplicate the test at line 171.

describe 'Abstract with scope and content displayLabel and no type, nonstandard capitalization' do
# normalize this displayLabel to be lowercase after first letter
it_behaves_like 'MODS cocina mapping' do
let(:mods) do
<<~XML
<abstract displayLabel="Scope and Content">Scope and content</abstract>
XML
end

let(:roundtrip_mods) do
<<~XML
<abstract displayLabel="Scope and content">Scope and content</abstract>
XML
end

let(:cocina) do
{
note: [
{
value: 'Scope and content',
displayLabel: 'Scope and content'
}
]
}
end
end
end

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normalization not needed in Cocina>MODS direction.

describe 'Abstract with displayLabel "Abstract" and no type' do
it_behaves_like 'MODS cocina mapping' do
let(:mods) do
<<~XML
<abstract displayLabel="Abstract">Abstract</abstract>
XML
end

let(:cocina) do
{
note: [
{
value: 'Abstract',
displayLabel: 'Abstract'
}
]
}
end
end
end

describe 'Abstract with displayLabel "Content advice" and no type' do
it_behaves_like 'MODS cocina mapping' do
let(:mods) do
<<~XML
<abstract displayLabel="Content advice">Content advice</abstract>
XML
end

let(:cocina) do
{
note: [
{
value: 'Content advice',
displayLabel: 'Content advice'
}
]
}
end
end
end

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicative of test at line 171.

describe 'Abstract with content advice displayLabel and no type, nonstandard capitalization' do
# normalize this displayLabel to be lowercase after first letter
it_behaves_like 'MODS cocina mapping' do
let(:mods) do
<<~XML
<abstract displayLabel="Content Advice">Content advice</abstract>
XML
end

let(:roundtrip_mods) do
<<~XML
<abstract displayLabel="Content advice">Content advice</abstract>
XML
end

let(:cocina) do
{
note: [
{
value: 'Content advice',
displayLabel: 'Content advice'
}
]
}
end
end
end

describe 'Abstract with other displayLabel, capitalization retained' do
it_behaves_like 'MODS cocina mapping' do
let(:mods) do
<<~XML
<abstract displayLabel="Summary from Barnes Catalogue of Works">A summary.</abstract>
XML
end

let(:cocina) do
{
note: [
{
value: 'A summary.',
type: 'abstract',
displayLabel: 'Summary from Barnes Catalogue of Works'
}
]
}
end
end
end

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normalization not needed in Cocina>MODS direction.

describe 'Link to external value only' do
it_behaves_like 'MODS cocina mapping' do
let(:mods) do
Expand Down