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

Fix holdingType typo #1002

Merged
merged 1 commit into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/folio/eresource_holdings_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def mapped_location_codes
# This approach works fine unless there are records with multiple
# e-resource holdings associated with different locations.
def electronic_holding_location
@electronic_holding_location ||= holdings&.find { |h| (h.dig('holdingType', 'name') || h.dig('location', 'effectiveLocation', 'details', 'holdingTypeName')) == 'Electronic' }
@electronic_holding_location ||= holdings&.find { |h| (h.dig('holdingsType', 'name') || h.dig('location', 'effectiveLocation', 'details', 'holdingsTypeName')) == 'Electronic' }
end
end
end
4 changes: 2 additions & 2 deletions spec/integration/folio_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
let(:items_and_holdings) do
{ 'items' => [],
'holdings' =>
[{ 'holdingType' => { 'name' => 'Electronic' },
[{ 'holdingsType' => { 'name' => 'Electronic' },
'location' =>
{ 'permanentLocation' =>
{ 'code' => 'SUL-ELECTRONIC' },
Expand Down Expand Up @@ -147,7 +147,7 @@
let(:items_and_holdings) do
{ 'items' => [],
'holdings' =>
[{ 'holdingType' => { 'name' => 'Electronic' },
[{ 'holdingsType' => { 'name' => 'Electronic' },
'location' =>
{ 'permanentLocation' =>
{ 'code' => 'LAW-ELECTRONIC' },
Expand Down
12 changes: 6 additions & 6 deletions spec/lib/folio/eresource_holdings_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
let(:items_and_holdings) do
{ 'items' => [],
'holdings' =>
[{ 'holdingType' => { 'name' => 'Electronic' },
[{ 'holdingsType' => { 'name' => 'Electronic' },
'location' =>
{ 'permanentLocation' =>
{ 'code' => 'SUL-ELECTRONIC' },
Expand Down Expand Up @@ -64,7 +64,7 @@
let(:items_and_holdings) do
{ 'items' => [],
'holdings' =>
[{ 'holdingType' => { 'name' => 'Electronic' },
[{ 'holdingsType' => { 'name' => 'Electronic' },
'location' =>
{ 'permanentLocation' =>
{ 'code' => 'LAW-ELECTRONIC' },
Expand All @@ -82,7 +82,7 @@
let(:items_and_holdings) do
{ 'items' => [],
'holdings' =>
[{ 'holdingType' => { 'name' => 'Whatever' } }] }
[{ 'holdingsType' => { 'name' => 'Whatever' } }] }
end

it { expect(holdings).to be_empty }
Expand All @@ -92,7 +92,7 @@
let(:items_and_holdings) do
{ 'items' => [],
'holdings' =>
[{ 'holdingType' => { 'name' => 'Electronic' }, 'location' =>
[{ 'holdingsType' => { 'name' => 'Electronic' }, 'location' =>
{ 'permanentLocation' =>
{ 'code' => 'SUL-SDR' },
'effectiveLocation' =>
Expand All @@ -104,15 +104,15 @@
it { expect(holdings.first.home_location).to eq 'INTERNET' }
end

context 'the holding library is Lane (without a explicit holdingType)' do
context 'the holding library is Lane (without a explicit holdingsType)' do
let(:items_and_holdings) do
{ 'items' => [],
'holdings' =>
[{ 'location' =>
{ 'permanentLocation' =>
{ 'code' => 'LANE-EDATA' },
'effectiveLocation' =>
{ 'code' => 'LANE-EDATA', 'details' => { 'holdingTypeName' => 'Electronic' } } },
{ 'code' => 'LANE-EDATA', 'details' => { 'holdingsTypeName' => 'Electronic' } } },
'suppressFromDiscovery' => false,
'id' => '81a56270-e8dd-5759-8083-5cc96cdf0045',
'holdingsStatements' => [] }] }
Expand Down