Skip to content

Commit

Permalink
Fix holdingType typo
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Jul 25, 2023
1 parent 7b29ad5 commit dd169fc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
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

0 comments on commit dd169fc

Please sign in to comment.