diff --git a/Gemfile b/Gemfile index d092ef9d..4a690a32 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ ruby File.read('.ruby-version').strip gem 'awesome_print', '>=1.8.0' gem 'base64' gem 'berkeley_library-docker', '~> 0.2.0' -gem 'berkeley_library-location', '~> 4.1.0' +gem 'berkeley_library-location', '~> 4.2.0' gem 'berkeley_library-logging', '~> 0.2', '>= 0.2.7' gem 'berkeley_library-marc', '~> 0.3.1' gem 'berkeley_library-tind', '~> 0.8.0' diff --git a/Gemfile.lock b/Gemfile.lock index dcfbc325..c310cd5b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -81,7 +81,7 @@ GEM berkeley_library-util (~> 0.1, >= 0.1.2) nokogiri (~> 1.13, >= 1.13.6) berkeley_library-docker (0.2.0) - berkeley_library-location (4.1.0) + berkeley_library-location (4.2.0) berkeley_library-logging (~> 0.2) berkeley_library-util (~> 0.1, >= 0.1.9) jsonpath (~> 0.5.8) @@ -198,7 +198,7 @@ GEM thor (>= 0.14, < 2.0) jquery-ui-rails (6.0.1) railties (>= 3.2.16) - json (2.6.2) + json (2.7.2) jsonpath (0.5.8) multi_json jwt (1.5.6) @@ -233,7 +233,7 @@ GEM mime-types-data (3.2025.0722) mini_mime (1.1.5) minitest (5.25.5) - multi_json (1.15.0) + multi_json (1.19.1) mutex_m (0.3.0) net-imap (0.5.9) date @@ -252,8 +252,6 @@ GEM racc (~> 1.4) nokogiri (1.18.9-arm64-darwin) racc (~> 1.4) - nokogiri (1.18.9-x86_64-darwin) - racc (~> 1.4) nokogiri (1.18.9-x86_64-linux-gnu) racc (~> 1.4) oj (3.16.11) @@ -335,7 +333,7 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rexml (3.4.1) + rexml (3.4.4) roo (2.9.0) nokogiri (~> 1) rubyzip (>= 1.3.0, < 3.0.0) @@ -396,9 +394,9 @@ GEM ruby-prof (1.3.2) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - rubyXL (3.4.33) + rubyXL (3.4.34) nokogiri (>= 1.10.8) - rubyzip (>= 1.3.0) + rubyzip (~> 2.4) rubyzip (2.4.1) sassc (2.4.0) ffi (~> 1.9) @@ -463,19 +461,15 @@ GEM zeitwerk (2.7.3) PLATFORMS - aarch64-linux - arm64-darwin-21 + aarch64-linux-gnu arm64-darwin-23 - arm64-darwin-24 - x86_64-darwin-19 - x86_64-darwin-21 x86_64-linux DEPENDENCIES awesome_print (>= 1.8.0) base64 berkeley_library-docker (~> 0.2.0) - berkeley_library-location (~> 4.1.0) + berkeley_library-location (~> 4.2.0) berkeley_library-logging (~> 0.2, >= 0.2.7) berkeley_library-marc (~> 0.3.1) berkeley_library-tind (~> 0.8.0) @@ -533,7 +527,7 @@ DEPENDENCIES webmock RUBY VERSION - ruby 3.3.8p144 + ruby 3.3.10p183 BUNDLED WITH - 2.5.22 + 2.5.3 diff --git a/app/controllers/location_requests_controller.rb b/app/controllers/location_requests_controller.rb index 5cf5c439..9014b68a 100644 --- a/app/controllers/location_requests_controller.rb +++ b/app/controllers/location_requests_controller.rb @@ -4,7 +4,7 @@ class LocationRequestsController < ApplicationController before_action :require_framework_admin!, only: %i[immediate index] REQUIRED_PARAMS = %i[email input_file].freeze - OPTIONAL_PARAMS = %i[rlf uc hathi immediate].freeze + OPTIONAL_PARAMS = %i[slf uc hathi immediate].freeze ALL_PARAMS = (REQUIRED_PARAMS + OPTIONAL_PARAMS) # GET /location_requests diff --git a/app/models/location_request.rb b/app/models/location_request.rb index 81e98927..ad2adecc 100644 --- a/app/models/location_request.rb +++ b/app/models/location_request.rb @@ -117,7 +117,7 @@ def ensure_admin_if_immediate(request, user:) # Synthetic accessors def world_cat? - rlf? || uc? + slf? || uc? end def incomplete? @@ -207,7 +207,7 @@ def search_wc_symbols return unless world_cat? [].tap do |symbols| - symbols.concat(BerkeleyLibrary::Location::WorldCat::Symbols::RLF) if rlf? + symbols.concat(BerkeleyLibrary::Location::WorldCat::Symbols::SLF) if slf? symbols.concat(BerkeleyLibrary::Location::WorldCat::Symbols::UC) if uc? end end @@ -249,7 +249,7 @@ def with_uploaded_input_file def options_selected return if world_cat? || hathi? - errors.add(:base, 'At least one of RLF, Other UC, or HathiTrust must be selected') + errors.add(:base, 'At least one of SLF, Other UC, or HathiTrust must be selected') end def new_result(oclc_number, wc_sym_str, wc_error, ht_record_url, ht_error) @@ -269,7 +269,7 @@ def write_output_file! end def write_results_to(ss) - writer = XLSXWriter.new(ss, rlf:, uc:, hathi_trust: hathi) + writer = XLSXWriter.new(ss, slf:, uc:, hathi_trust: hathi) result_data = location_records.pluck(*RESULT_ARGS) result_data.each { |row| writer << new_result(*row) } end diff --git a/app/views/fees/_nonberk_instructions.html.erb b/app/views/fees/_nonberk_instructions.html.erb index 1a322868..96ee3b7d 100644 --- a/app/views/fees/_nonberk_instructions.html.erb +++ b/app/views/fees/_nonberk_instructions.html.erb @@ -13,7 +13,7 @@
Checks OCLC for - <%= BerkeleyLibrary::Location::WorldCat::Symbols::NRLF.join('/') %> + <%= BerkeleyLibrary::Location::WorldCat::Symbols::SLFN.join('/') %> and - <%= BerkeleyLibrary::Location::WorldCat::Symbols::SRLF.join('/') %> + <%= BerkeleyLibrary::Location::WorldCat::Symbols::SLFS.join('/') %> holdings symbols
| <%= t("activerecord.attributes.location_request.#{opt}") %> | diff --git a/app/views/location_requests/index.html.erb b/app/views/location_requests/index.html.erb index f7b3a1d0..a0245505 100644 --- a/app/views/location_requests/index.html.erb +++ b/app/views/location_requests/index.html.erb @@ -11,7 +11,7 @@ | Input file | -RLF | +SLF | UC | HT | Submitted | @@ -34,7 +34,7 @@ <%= location_request.filename %> <% end %> - <% [:rlf, :uc, :hathi].each do |opt| %> + <% [:slf, :uc, :hathi].each do |opt| %>
<% value = location_request.send(opt) || false %>
<%= t("activerecord.attributes.location_request.include.#{value}") %>
diff --git a/app/views/location_requests/new.html.erb b/app/views/location_requests/new.html.erb
index fe9f6871..b37dc58e 100644
--- a/app/views/location_requests/new.html.erb
+++ b/app/views/location_requests/new.html.erb
@@ -2,8 +2,8 @@
The Location Request tool takes an OCLC number and queries OCLC and/or HathiTrust. The tool is good for searching for single-volume monographs. For multi-volume monographs - or serials, the tool is most useful if nothing is held at an RLF. If an OCLC number is - found at an RLF or HathiTrust, more checking will be necessary to determine which + or serials, the tool is most useful if nothing is held at an SLF. If an OCLC number is + found at an SLF or HathiTrust, more checking will be necessary to determine which volume(s) is/are actually held. diff --git a/app/views/reference_card_forms/show.html.erb b/app/views/reference_card_forms/show.html.erb index c01c0a75..980f9867 100644 --- a/app/views/reference_card_forms/show.html.erb +++ b/app/views/reference_card_forms/show.html.erb @@ -58,7 +58,7 @@ 'denial_reason', ['Item listed at another library', '3-month maximum exceeded', - 'Item at NRLF', + 'Item at SLF-N', 'Other'], {prompt: 'Select reason for denial'}, {:class => 'custom-select custom-select-sm col-md-4', diff --git a/app/views/request_mailer/reference_card_denied.html.erb b/app/views/request_mailer/reference_card_denied.html.erb index 626b2a8e..f304b353 100644 --- a/app/views/request_mailer/reference_card_denied.html.erb +++ b/app/views/request_mailer/reference_card_denied.html.erb @@ -4,9 +4,9 @@ <% elsif @reference_card_form.denial_reason == '3-month maximum exceeded' %>Denied - 3-month maximum exceeded Your request for a Reference Card has been denied. The maximum allowed Reference Card term is 3 months in one year. You have exceeded the term limit. -<% elsif @reference_card_form.denial_reason == 'Item at NRLF' %> -Denied - Item at NRLF -Your request for a Reference Card has been denied. The item that you have listed <%= @reference_card_form.local_id %> is not located in the Main (Gardner) Stacks, it is located off site at the <%= link_to 'Northern Regional Library Facility (NRLF)', 'https://www.lib.berkeley.edu/libraries/nrlf' %>. You may contact NRLF to request to have the item pulled so you may view it on-site at NRLF. Alternatively, if you would like to view this item on the UC Berkeley campus, please call the <%= link_to 'Main Circulation Desk', 'https://www.lib.berkeley.edu/libraries/doe-library' %> to request to have the item sent from NRLF to campus. +<% elsif @reference_card_form.denial_reason == 'Item at SLF-N' %> +Denied - Item at SLF-N +Your request for a Reference Card has been denied. The item that you have listed <%= @reference_card_form.local_id %> is not located in the Main (Gardner) Stacks, it is located off site at the <%= link_to 'Systemwide Library Facility-North (SLF-N)', 'https://www.lib.berkeley.edu/libraries/nrlf' %>. You may contact SLF-N to request to have the item pulled so you may view it on-site at SLF-N. Alternatively, if you would like to view this item on the UC Berkeley campus, please call the <%= link_to 'Main Circulation Desk', 'https://www.lib.berkeley.edu/libraries/doe-library' %> to request to have the item sent from SLF-N to campus. <% else %>Denied - Other Your request for a Reference Card has been denied for the following reason: <%= @reference_card_form.denial_reason %>. diff --git a/app/views/request_mailer/reference_card_denied.text.erb b/app/views/request_mailer/reference_card_denied.text.erb index 1d81d090..6fba093c 100644 --- a/app/views/request_mailer/reference_card_denied.text.erb +++ b/app/views/request_mailer/reference_card_denied.text.erb @@ -4,9 +4,9 @@ <% elsif @reference_card_form.denial_reason == '3-month maximum exceeded' %> Denied - 3-month maximum exceeded Your request for a Reference Card has been denied. The maximum allowed Reference Card term is 3 months in one year. You have exceeded the term limit. -<% elsif @reference_card_form.denial_reason == 'Item at NRLF' %> - Denied - Item at NRLF - Your request for a Reference Card has been denied. The item that you have listed <%= @reference_card_form.local_id %> is not located in the Main (Gardner) Stacks, it is located off site at the <%= link_to 'Northern Regional Library Facility (NRLF)', 'https://www.lib.berkeley.edu/libraries/nrlf' %>. You may contact NRLF to request to have the item pulled so you may view it on-site at NRLF. Alternatively, if you would like to view this item on the UC Berkeley campus, please call the <%= link_to 'Main Circulation Desk', 'https://www.lib.berkeley.edu/libraries/doe-library' %> to request to have the item sent from NRLF to campus. +<% elsif @reference_card_form.denial_reason == 'Item at SLF-N' %> + Denied - Item at SLF-N + Your request for a Reference Card has been denied. The item that you have listed <%= @reference_card_form.local_id %> is not located in the Main (Gardner) Stacks, it is located off site at the <%= link_to 'Systemwide Library Facility-North (SLF-N)', 'https://www.lib.berkeley.edu/libraries/nrlf' %>. You may contact SLF-N to request to have the item pulled so you may view it on-site at SLF-N. Alternatively, if you would like to view this item on the UC Berkeley campus, please call the <%= link_to 'Main Circulation Desk', 'https://www.lib.berkeley.edu/libraries/doe-library' %> to request to have the item sent from SLF-N to campus. <% else %> Denied - Other Your request for a Reference Card has been denied for the following reason: <%= @reference_card_form.denial_reason %>. diff --git a/app/views/request_mailer/stack_pass_denied.html.erb b/app/views/request_mailer/stack_pass_denied.html.erb index 713bd4dc..363c9ebb 100644 --- a/app/views/request_mailer/stack_pass_denied.html.erb +++ b/app/views/request_mailer/stack_pass_denied.html.erb @@ -4,9 +4,9 @@ <% elsif @stackpass_form.denial_reason == 'Too many passes requested' %>Denied - Too many passes requested Our records show that you have utilized more than our limit of ad hoc day passes to the Main (Gardner) Stacks. Please come in person to speak with a reference librarian regarding your project to see if a more long-term option is available to you. Please also see the <%= link_to 'Information for Alumni', 'https://www.lib.berkeley.edu/information/alumni'%> and <%= link_to 'Information for Visitors', 'https://www.lib.berkeley.edu/information/visitors' %> pages on the <%= link_to 'UC Berkeley Library website', 'https://www.lib.berkeley.edu/' %>. -<% elsif @stackpass_form.denial_reason == 'Item at NRLF' %> -Denied - Item at NRLF -Your request for a Stack Pass has been denied. The item that you have listed <%= @stackpass_form.local_id %> is not located in the Main (Gardner) Stacks, it is located off-site at the <%= link_to 'Northern Regional Library Facility (NRLF)', 'https://www.lib.berkeley.edu/libraries/nrlf' %>. You may contact NRLF to request to have the item pulled so you may view it on-site at NRLF. Alternatively, if you would like to view this item on the UC Berkeley campus, please call the <%= link_to 'Main Circulation Desk', 'https://www.lib.berkeley.edu/libraries/doe-library' %> to request to have the item sent from NRLF to campus. +<% elsif @stackpass_form.denial_reason == 'Item at SLF-N' %> +Denied - Item at SLF-N +Your request for a Stack Pass has been denied. The item that you have listed <%= @stackpass_form.local_id %> is not located in the Main (Gardner) Stacks, it is located off-site at the <%= link_to 'Systemwide Library Facility-North (SLF-N)', 'https://www.lib.berkeley.edu/libraries/nrlf' %>. You may contact SLF-N to request to have the item pulled so you may view it on-site at SLF-N. Alternatively, if you would like to view this item on the UC Berkeley campus, please call the <%= link_to 'Main Circulation Desk', 'https://www.lib.berkeley.edu/libraries/doe-library' %> to request to have the item sent from SLF-N to campus. <% else %>Denied - reason Other Your request for a Stack Pass has been denied for the following reason: <%= @stackpass_form.denial_reason %>. diff --git a/app/views/request_mailer/stack_pass_denied.text.erb b/app/views/request_mailer/stack_pass_denied.text.erb index 93c1def3..921374ac 100644 --- a/app/views/request_mailer/stack_pass_denied.text.erb +++ b/app/views/request_mailer/stack_pass_denied.text.erb @@ -4,9 +4,9 @@ <% elsif @stackpass_form.denial_reason == 'Too many passes requested' %> Denied - Too many passes requested Our records show that you have utilized more than our limit of ad hoc day passes to the Main (Gardner) Stacks. Please come in person to speak with a reference librarian regarding your project to see if a more long-term option is available to you. Please also see the <%= link_to 'Information for Alumni', 'https://www.lib.berkeley.edu/information/alumni'%> and <%= link_to 'Information for Visitors', 'https://www.lib.berkeley.edu/information/visitors' %> pages on the <%= link_to 'UC Berkeley Library website', 'https://www.lib.berkeley.edu/' %>. -<% elsif @stackpass_form.denial_reason == 'Item at NRLF' %> - Denied - Item at NRLF - Your request for a Stack Pass has been denied. The item that you have listed <%= @stackpass_form.local_id %> is not located in the Main (Gardner) Stacks, it is located off-site at the <%= link_to 'Northern Regional Library Facility (NRLF)', 'https://www.lib.berkeley.edu/libraries/nrlf' %>. You may contact NRLF to request to have the item pulled so you may view it on-site at NRLF. Alternatively, if you would like to view this item on the UC Berkeley campus, please call the <%= link_to 'Main Circulation Desk', 'https://www.lib.berkeley.edu/libraries/doe-library' %> to request to have the item sent from NRLF to campus. +<% elsif @stackpass_form.denial_reason == 'Item at SLF-N' %> + Denied - Item at SLF-N + Your request for a Stack Pass has been denied. The item that you have listed <%= @stackpass_form.local_id %> is not located in the Main (Gardner) Stacks, it is located off-site at the <%= link_to 'Systemwide Library Facility-North (SLF-N)', 'https://www.lib.berkeley.edu/libraries/nrlf' %>. You may contact SLF-N to request to have the item pulled so you may view it on-site at SLF-N. Alternatively, if you would like to view this item on the UC Berkeley campus, please call the <%= link_to 'Main Circulation Desk', 'https://www.lib.berkeley.edu/libraries/doe-library' %> to request to have the item sent from SLF-N to campus. <% else %> Denied - reason Other Your request for a Stack Pass has been denied for the following reason: <%= @stackpass_form.denial_reason %>. diff --git a/app/views/stack_pass_forms/show.html.erb b/app/views/stack_pass_forms/show.html.erb index 91fcf0d6..e4a639e2 100644 --- a/app/views/stack_pass_forms/show.html.erb +++ b/app/views/stack_pass_forms/show.html.erb @@ -54,7 +54,7 @@ 'denial_reason', ['Item listed at another library', 'Too many passes requested', - 'Item at NRLF', + 'Item at SLF-N', 'Other'], {prompt: 'Select reason for denial'}, {:class => 'custom-select custom-select-sm col-md-4', diff --git a/config/locales/en.yml b/config/locales/en.yml index a3ad25cf..8f9862e0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -64,7 +64,7 @@ en: filename: Input file input_file: Input file output_file: Output file - rlf: NRLF/SRLF holdings + slf: SLF-N/SLF-S holdings uc: UC campus library holdings hathi: HathiTrust URLs include: diff --git a/db/migrate/20251222223043_rename_rlf_to_slf_on_location_requests.rb b/db/migrate/20251222223043_rename_rlf_to_slf_on_location_requests.rb new file mode 100644 index 00000000..854bc365 --- /dev/null +++ b/db/migrate/20251222223043_rename_rlf_to_slf_on_location_requests.rb @@ -0,0 +1,5 @@ +class RenameRlfToSlfOnLocationRequests < ActiveRecord::Migration[7.0] + def change + rename_column :location_requests, :rlf, :slf + end +end diff --git a/db/schema.rb b/db/schema.rb index 87caa02f..cba27c8a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2025_04_04_180042) do +ActiveRecord::Schema[7.0].define(version: 2025_12_22_223043) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -186,7 +186,7 @@ create_table "location_requests", force: :cascade do |t| t.string "email", null: false t.string "filename", null: false - t.boolean "rlf", default: false, null: false + t.boolean "slf", default: false, null: false t.boolean "uc", default: false, null: false t.boolean "hathi", default: false, null: false t.datetime "created_at", null: false diff --git a/spec/data/location/world_cat/39281966.json b/spec/data/location/world_cat/39281966.json index c7901222..416fca3f 100644 --- a/spec/data/location/world_cat/39281966.json +++ b/spec/data/location/world_cat/39281966.json @@ -59,7 +59,7 @@ "oclcSymbol": "ZAP", "registryId": 5690, "institutionNumber": 4218, - "institutionName": "University of California, NRLF", + "institutionName": "University of California, SLF-N", "alsoCalled": "Northern Regional Library Facility", "hasOPACLink": true, "self": "https://worldcat.org/oclc-config/institution/data/5690", diff --git a/spec/data/location/world_cat/43903564.json b/spec/data/location/world_cat/43903564.json index 227ecbb8..b5da5225 100644 --- a/spec/data/location/world_cat/43903564.json +++ b/spec/data/location/world_cat/43903564.json @@ -63,7 +63,7 @@ "oclcSymbol": "ZAP", "registryId": 5690, "institutionNumber": 4218, - "institutionName": "University of California, NRLF", + "institutionName": "University of California, SLF-N", "alsoCalled": "Northern Regional Library Facility", "hasOPACLink": true, "self": "https://worldcat.org/oclc-config/institution/data/5690", diff --git a/spec/data/location/world_cat/52937386.json b/spec/data/location/world_cat/52937386.json index 85fd3e86..8361e34e 100644 --- a/spec/data/location/world_cat/52937386.json +++ b/spec/data/location/world_cat/52937386.json @@ -95,7 +95,7 @@ "oclcSymbol": "ZAP", "registryId": 5690, "institutionNumber": 4218, - "institutionName": "University of California, NRLF", + "institutionName": "University of California, SLF-N", "alsoCalled": "Northern Regional Library Facility", "hasOPACLink": true, "self": "https://worldcat.org/oclc-config/institution/data/5690", diff --git a/spec/jobs/location/world_cat_job_spec.rb b/spec/jobs/location/world_cat_job_spec.rb index 9e7630f7..ef716be0 100644 --- a/spec/jobs/location/world_cat_job_spec.rb +++ b/spec/jobs/location/world_cat_job_spec.rb @@ -11,7 +11,7 @@ module Location end it 'rejects a non-Worldcat request' do - req.update(rlf: false, uc: false) + req.update(slf: false, uc: false) expect { WorldCatJob.perform_now(req) }.to raise_error(ArgumentError) end diff --git a/spec/models/location_request_spec.rb b/spec/models/location_request_spec.rb index 641ce129..92c21ea1 100644 --- a/spec/models/location_request_spec.rb +++ b/spec/models/location_request_spec.rb @@ -48,7 +48,7 @@ def assert_same_contents(expected_path, actual_attachment) @valid_attributes = { email: 'me@example.test', filename: 'test.xlsx', - rlf: true, + slf: true, uc: true, hathi: true, input_file: uploaded_file @@ -77,7 +77,7 @@ def assert_same_contents(expected_path, actual_attachment) end it 'requires at least one option to be set' do - invalid_attributes = valid_attributes.except(:rlf, :uc, :hathi) + invalid_attributes = valid_attributes.except(:slf, :uc, :hathi) req = LocationRequest.new(**invalid_attributes) expect(req).not_to be_valid end @@ -222,7 +222,7 @@ def assert_same_contents(expected_path, actual_attachment) req = LocationRequest.create!( email: 'me@example.test', filename: input_file_basename, - rlf: true, + slf: true, input_file: { io: File.open(input_file_path), filename: input_file_basename, @@ -261,20 +261,20 @@ def assert_same_contents(expected_path, actual_attachment) end it 'returns nil for HathiTrust-only requests' do - attributes = valid_attributes.except(:rlf, :uc) + attributes = valid_attributes.except(:slf, :uc) req = LocationRequest.create!(**attributes) expect(req.search_wc_symbols).to be_nil end - it 'returns RLF symbols for RLF requests' do + it 'returns SLF symbols for SLF requests' do attributes = valid_attributes.except(:uc) req = LocationRequest.create!(**attributes) - symbols_expected = BerkeleyLibrary::Location::WorldCat::Symbols::RLF + symbols_expected = BerkeleyLibrary::Location::WorldCat::Symbols::SLF expect(req.search_wc_symbols).to match_array(symbols_expected) end it 'returns UC symbols for UC requests' do - attributes = valid_attributes.except(:rlf) + attributes = valid_attributes.except(:slf) req = LocationRequest.create!(**attributes) symbols_expected = BerkeleyLibrary::Location::WorldCat::Symbols::UC expect(req.search_wc_symbols).to match_array(symbols_expected) diff --git a/spec/requests/location_requests_spec.rb b/spec/requests/location_requests_spec.rb index 204c6d60..ec086017 100644 --- a/spec/requests/location_requests_spec.rb +++ b/spec/requests/location_requests_spec.rb @@ -153,7 +153,7 @@ { email: 'test@example.org', input_file: fixture_file_upload('spec/data/location/input-file.xlsx'), - rlf: true, + slf: true, uc: true, hathi: true } @@ -361,7 +361,7 @@ def assert_location_retrieved context 'no include flags present' do it_behaves_like 'an invalid request' do - let(:invalid_attributes) { valid_attributes.except(:rlf, :uc, :hathi) } + let(:invalid_attributes) { valid_attributes.except(:slf, :uc, :hathi) } end end diff --git a/spec/support/location_contexts.rb b/spec/support/location_contexts.rb index 6cdc161f..87744015 100644 --- a/spec/support/location_contexts.rb +++ b/spec/support/location_contexts.rb @@ -185,7 +185,7 @@ def verify_wc_symbols(record) email: 'dmoles@berkeley.edu', filename: 'input-file.xlsx', hathi: true, - rlf: true, + slf: true, uc: true, input_file: uploaded_file_from(input_file_path) ) @@ -209,8 +209,8 @@ def verify_wc_symbols(record) end def assert_complete!(ss) - cnames = ['OCLC Number', 'NRLF', 'SRLF', 'Other UC', 'Hathi Trust'] - c_oclc, c_nrlf, c_srlf, c_uc, c_ht = cnames.map do |cname| + cnames = ['OCLC Number', 'SLFN', 'SLFS', 'Other UC', 'Hathi Trust'] + c_oclc, c_slfn, c_slfs, c_uc, c_ht = cnames.map do |cname| ss.find_column_index_by_header!(cname) end @@ -218,16 +218,16 @@ def assert_complete!(ss) r_index = i + 1 # skip header wc_symbols = locations_by_oclc_num[oclc_number] - has_nrlf = wc_symbols.intersect?(BerkeleyLibrary::Location::WorldCat::Symbols::NRLF) - has_srlf = wc_symbols.intersect?(BerkeleyLibrary::Location::WorldCat::Symbols::SRLF) + has_slfn = wc_symbols.intersect?(BerkeleyLibrary::Location::WorldCat::Symbols::SLFN) + has_slfs = wc_symbols.intersect?(BerkeleyLibrary::Location::WorldCat::Symbols::SLFS) expected_uc = wc_symbols.intersection(BerkeleyLibrary::Location::WorldCat::Symbols::UC) ht_record_url = record_urls_expected[oclc_number] expected_values = { c_oclc => oclc_number.to_i, # source data is numeric - c_nrlf => ('nrlf' if has_nrlf), - c_srlf => ('srlf' if has_srlf), + c_slfn => ('slfn' if has_slfn), + c_slfs => ('slfs' if has_slfs), c_uc => (expected_uc.join(',') if expected_uc.any?), c_ht => ht_record_url } |
|---|