Skip to content

Commit

Permalink
Primary source genre: add tests for Personal narratives and Personal …
Browse files Browse the repository at this point in the history
…narratives, Italian
  • Loading branch information
sandbergja committed Oct 17, 2024
1 parent bad192b commit 756ac29
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions spec/marc_to_solr/lib/genre_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,26 @@
expect(genres).to include('Primary source')
end
end
context 'when the 650 subfield v has Personal narratives' do
let(:genres) do
g650 = { "650" => { "ind1" => " ", "ind2" => "0", "subfields" => [{ "a" => "World War, 1939-1945" }, { "v" => "Personal narratives." }] } }
sample_marc = MARC::Record.new_from_hash('fields' => [g650])
described_class.new(sample_marc).to_a
end
it 'includes Primary Source in the list of genres' do
expect(genres).to include('Primary source')
end
end
context 'when the 650 subfield v has Personal narratives, Italian.' do
let(:genres) do
g650 = { "650" => { "ind1" => " ", "ind2" => "0", "subfields" => [{ "a" => "World War, 1939-1945" }, { "v" => "Personal narratives, Italian." }] } }
sample_marc = MARC::Record.new_from_hash('fields' => [g650])
described_class.new(sample_marc).to_a
end
it 'includes Primary Source in the list of genres' do
expect(genres).to include('Primary source')
end
end
context 'when the 650 subfield v has Pamphlets, and the 008 says it is a novel' do
let(:genres) do
g008 = { "008" => 'f'.rjust(34) } # f = Novel when it is in the 33rd position
Expand Down

0 comments on commit 756ac29

Please sign in to comment.