Skip to content

Commit

Permalink
Comment out request test until we resolve #3872
Browse files Browse the repository at this point in the history
Co-authored-by: Kevin Reiss <kevinreiss@users.noreply.github.com>
  • Loading branch information
christinach and kevinreiss committed Dec 4, 2023
1 parent 97b0d34 commit a0b14ad
Show file tree
Hide file tree
Showing 5 changed files with 287 additions and 45 deletions.
204 changes: 204 additions & 0 deletions spec/cassettes/request_features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9915,4 +9915,208 @@ http_interactions:
in place","status_source":"base_status","process_type":null,"on_reserve":"N","item_type":"Closed","pickup_location_id":"mendel","pickup_location_code":"mendel","location":"mendel$pk","label":"Mendel
Music Library - Remote Storage (ReCAP)","description":"","enum_display":"","chron_display":"","in_temp_library":false}]'
recorded_at: Wed, 22 Nov 2023 15:07:01 GMT
- request:
method: get
uri: https://catalog.princeton.edu/catalog/99129134216906421/raw
body:
encoding: US-ASCII
string: ''
headers:
User-Agent:
- Faraday v2.7.11
Accept-Encoding:
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept:
- "*/*"
response:
status:
code: 200
message: OK
headers:
Server:
- nginx/1.25.1
Date:
- Mon, 04 Dec 2023 19:24:42 GMT
Content-Type:
- application/json; charset=utf-8
Transfer-Encoding:
- chunked
Connection:
- keep-alive
Status:
- 200 OK
Cache-Control:
- max-age=0, private, must-revalidate
Referrer-Policy:
- strict-origin-when-cross-origin
X-Permitted-Cross-Domain-Policies:
- none
X-Xss-Protection:
- 1; mode=block
X-Request-Id:
- e92f5f00-2e4e-447c-86da-610f8fc9dc78
X-Download-Options:
- noopen
X-Ua-Compatible:
- IE=edge,chrome=1
Etag:
- W/"15b353a1ac68b84f032d15a1564aed3b"
X-Frame-Options:
- SAMEORIGIN
X-Runtime:
- '0.046709'
X-Content-Type-Options:
- nosniff
X-Powered-By:
- Phusion Passenger(R) 6.0.18
Access-Control-Allow-Origin:
- "*"
Access-Control-Allow-Credentials:
- 'true'
Access-Control-Allow-Methods:
- GET, POST, OPTIONS
Access-Control-Allow-Headers:
- DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Origin
body:
encoding: UTF-8
string: '{"id":"99129134216906421","numeric_id_b":true,"author_display":["Maltbia
, C. B."],"author_citation_display":["Maltbia , C. B."],"author_roles_1display":"{\"secondary_authors\":[],\"translators\":[],\"editors\":[],\"compilers\":[],\"primary_author\":\"Maltbia
, C. B.\"}","author_s":["Maltbia , C. B."],"marc_relator_display":["Author"],"title_display":"Harvesting
black gold : /","title_t":["Harvesting black gold : /"],"title_citation_display":["Harvesting
black gold :"],"compiled_created_t":["Harvesting black gold : /"],"pub_created_display":["[S.l]
: [s.n.], 2018"],"pub_created_s":["[S.l] : [s.n.], 2018"],"pub_citation_display":["S.l:
s.n."],"cataloged_tdt":"2023-12-01T15:42:15Z","format":["Book"],"description_display":["426
pages : ;"],"description_t":["426 pages : ;"],"number_of_pages_citation_display":["426
pages"],"language_name_display":["English"],"language_facet":["English"],"language_iana_s":["en"],"holdings_1display":"{\"221002424820006421\":{\"location_code\":\"recap$pa\",\"location\":\"Remote
Storage\",\"library\":\"ReCAP\",\"items\":[{\"holding_id\":\"221002424820006421\",\"id\":\"231002424810006421\",\"status_at_load\":\"0\"}]}}","location_code_s":["recap$pa"],"location":["ReCAP"],"location_display":["Remote
Storage"],"advanced_location_s":["recap$pa","ReCAP"],"name_title_browse_s":["Maltbia
, C. B.. Harvesting black gold"],"hashed_id_ssi":"de08c1240f3131eb","_version_":1784096895036030976,"timestamp":"2023-12-01T16:16:26.669Z"}'
recorded_at: Mon, 04 Dec 2023 19:24:42 GMT
- request:
method: get
uri: https://bibdata-staging.princeton.edu/locations/holding_locations/recap$pa.json
body:
encoding: US-ASCII
string: ''
headers:
User-Agent:
- Faraday v2.7.11
Accept-Encoding:
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept:
- "*/*"
response:
status:
code: 200
message: OK
headers:
Server:
- nginx/1.25.1
Date:
- Mon, 04 Dec 2023 19:24:42 GMT
Content-Type:
- application/json; charset=utf-8
Transfer-Encoding:
- chunked
Connection:
- keep-alive
Status:
- 200 OK
Access-Control-Allow-Headers:
- Origin, Content-Type, Accept, Authorization, Token
Cache-Control:
- max-age=0, private, must-revalidate
Access-Control-Allow-Origin:
- "*"
Etag:
- W/"a0a00dcf20999ce5b99a85175ea11b9d"
X-Runtime:
- '0.022952'
Access-Control-Request-Method:
- GET
X-Request-Id:
- 7be4b5b1-aa75-4fac-b336-d961cfff7577
X-Powered-By:
- Phusion Passenger(R) 6.0.19
body:
encoding: UTF-8
string: '{"label":"Remote Storage","code":"recap$pa","aeon_location":false,"recap_electronic_delivery_location":true,"open":false,"requestable":true,"always_requestable":false,"circulates":true,"remote_storage":"recap_rmt","fulfillment_unit":"Closed","library":{"label":"ReCAP","code":"recap","order":0},"holding_library":null,"delivery_locations":[{"label":"Plasma
Physics Library","address":"Forrestal Campus Princeton, NJ 08544","phone_number":"609-243-3565","contact_email":"lewislib@princeton.edu","gfa_pickup":"PQ","staff_only":false,"pickup_location":true,"digital_location":true,"library":{"label":"Harold
P. Furth Plasma Physics Library","code":"plasma","order":0}},{"label":"Technical
Services 693","address":"693 Alexander Rd. Princeton, NJ 08544","phone_number":"609-258-1470","contact_email":"catalogn@princeton.edu","gfa_pickup":"QT","staff_only":true,"pickup_location":true,"digital_location":false,"library":{"label":"Firestone
Library","code":"firestone","order":0}},{"label":"Architecture Library","address":"School
of Architecture Building, Second Floor Princeton, NJ 08544","phone_number":"609-258-3256","contact_email":"ues@princeton.edu","gfa_pickup":"PW","staff_only":false,"pickup_location":true,"digital_location":true,"library":{"label":"Architecture
Library","code":"arch","order":0}},{"label":"East Asian Library","address":"Frist
Campus Center, Room 317 Princeton, NJ 08544","phone_number":"609-258-3182","contact_email":"gestcirc@princeton.edu","gfa_pickup":"PL","staff_only":false,"pickup_location":true,"digital_location":true,"library":{"label":"East
Asian Library","code":"eastasian","order":0}},{"label":"Engineering Library","address":"Friend
Center for Engineering Education Princeton, NJ 08544","phone_number":"609-258-3200","contact_email":"englib@princeton.edu","gfa_pickup":"PT","staff_only":false,"pickup_location":true,"digital_location":true,"library":{"label":"Engineering
Library","code":"engineer","order":0}},{"label":"Mendel Music Library","address":"Woolworth
Center Princeton, NJ 08544","phone_number":"609-258-3230","contact_email":"muslib@princeton.edu","gfa_pickup":"PK","staff_only":false,"pickup_location":true,"digital_location":true,"library":{"label":"Mendel
Music Library","code":"mendel","order":0}},{"label":"Stokes Library","address":"Wallace
Hall, Lower Level Princeton, NJ 08544","phone_number":"609-258-5455","contact_email":"piaprlib@princeton.edu","gfa_pickup":"PM","staff_only":false,"pickup_location":true,"digital_location":true,"library":{"label":"Stokes
Library","code":"stokes","order":0}},{"label":"Firestone Library, Resource
Sharing","address":"One Washington Rd. Princeton, NJ 08544","phone_number":"609-258-1470","contact_email":"fstcirc@princeton.edu","gfa_pickup":"QA","staff_only":true,"pickup_location":true,"digital_location":false,"library":{"label":"Firestone
Library","code":"firestone","order":0}},{"label":"Lewis Library","address":"Washington
Road and Ivy Lane Princeton, NJ 08544","phone_number":"609-258-6004","contact_email":"lewislib@princeton.edu","gfa_pickup":"PN","staff_only":false,"pickup_location":true,"digital_location":true,"library":{"label":"Lewis
Library","code":"lewis","order":0}},{"label":"Firestone Library","address":"One
Washington Rd. Princeton, NJ 08544","phone_number":"609-258-1470","contact_email":"fstcirc@princeton.edu","gfa_pickup":"PA","staff_only":false,"pickup_location":true,"digital_location":true,"library":{"label":"Firestone
Library","code":"firestone","order":0}},{"label":"ReCAP ILL","address":"One
Washington Rd. Princeton, NJ 08544","phone_number":"609-258-1470","contact_email":"fstcirc@princeton.edu","gfa_pickup":"IL","staff_only":true,"pickup_location":false,"digital_location":false,"library":{"label":"Firestone
Library","code":"firestone","order":0}},{"label":"Technical Services HMT","address":"One
Washington Rd. Princeton, NJ 08544","phone_number":"609-258-1470","contact_email":"catalogn@princeton.edu","gfa_pickup":"QC","staff_only":true,"pickup_location":true,"digital_location":false,"library":{"label":"Firestone
Library","code":"firestone","order":0}},{"label":"Preservation","address":"One
Washington Rd. Princeton, NJ 08544","phone_number":"609-258-1470","contact_email":"fstcirc@princeton.edu","gfa_pickup":"QP","staff_only":true,"pickup_location":false,"digital_location":false,"library":{"label":"Firestone
Library","code":"firestone","order":0}}]}'
recorded_at: Mon, 04 Dec 2023 19:24:42 GMT
- request:
method: get
uri: https://bibdata-staging.princeton.edu/bibliographic/99129134216906421/holdings/221002424820006421/availability.json
body:
encoding: US-ASCII
string: ''
headers:
User-Agent:
- Faraday v2.7.11
Accept-Encoding:
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept:
- "*/*"
response:
status:
code: 200
message: OK
headers:
Server:
- nginx/1.25.1
Date:
- Mon, 04 Dec 2023 19:24:45 GMT
Content-Type:
- application/json; charset=utf-8
Transfer-Encoding:
- chunked
Connection:
- keep-alive
Status:
- 200 OK
Access-Control-Allow-Headers:
- Origin, Content-Type, Accept, Authorization, Token
Cache-Control:
- max-age=0, private, must-revalidate
Access-Control-Allow-Origin:
- "*"
Etag:
- W/"f6c1f1ed8c902f18246cb9c75676c2f5"
X-Runtime:
- '2.717808'
Access-Control-Request-Method:
- GET
X-Request-Id:
- 4c10beb4-5f62-4edb-95f9-8e452d587bd0
X-Powered-By:
- Phusion Passenger(R) 6.0.19
body:
encoding: UTF-8
string: '[{"barcode":"","id":"231002424810006421","holding_id":"221002424820006421","copy_number":"","status":"Unavailable","status_label":"Acquisition","status_source":"process_type","process_type":"ACQ","on_reserve":"N","item_type":"Gen","pickup_location_id":"recap","pickup_location_code":"recap","location":"recap$pa","label":"ReCAP
- Remote Storage","description":"","enum_display":"","chron_display":"","in_temp_library":false}]'
recorded_at: Mon, 04 Dec 2023 19:24:45 GMT
recorded_with: VCR 6.2.0
7 changes: 2 additions & 5 deletions spec/features/requests/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1434,23 +1434,20 @@
login_as user
end

it "does not allow physical pickup request On Order SCSB Recap Item" do
stub_scsb_availability(bib_id: "9994933183506421", institution_id: "PUL", barcode: '33333059902417')
visit 'requests/SCSB-6710959'
it "does not allow physical pickup request On Order PUL Recap Item" do
visit '/requests/99129134216906421?aeon=false&mfhd=221002424820006421'
expect(page).not_to have_content 'Electronic Delivery'
expect(page).not_to have_content 'Physical Item Delivery'
expect(page).to have_content 'This item is not available'
end

it "allows a physical pickup request of ReCAP Item" do
stub_scsb_availability(bib_id: "9941151723506421", institution_id: "PUL", barcode: '32101050751989')
visit 'requests/9941151723506421?mfhd=22492702000006421'
expect(page).not_to have_content 'Electronic Delivery'
expect(page).to have_content 'Physical Item Delivery'
end

it "allows a physical pickup request of a - Library In Use - ReCAP Item" do
stub_scsb_availability(bib_id: "99127133356906421", institution_id: "PUL", barcode: "32101111747083")
visit 'requests/99127133356906421?aeon=false&mfhd=22971539920006421'
expect(page).not_to have_content 'Electronic Delivery'
expect(page).to have_content 'Available for In Library Use'
Expand Down
63 changes: 62 additions & 1 deletion spec/fixtures/raw/scsb/SCSB-5396104.json
Original file line number Diff line number Diff line change
@@ -1 +1,62 @@
{"id":"SCSB-5396104","numeric_id_b":false,"other_id_s":["6516643"],"author_display":["Lee, Spike"],"author_citation_display":["Lee, Spike"],"author_roles_1display":"{\"secondary_authors\":[],\"translators\":[],\"editors\":[],\"compilers\":[],\"primary_author\":\"Lee, Spike\"}","author_s":["Lee, Spike"],"marc_relator_display":["Author"],"title_display":"Do the right thing [videorecording]","title_t":["Do the right thing [videorecording]"],"title_citation_display":["Do the right thing"],"compiled_created_t":["Do the right thing [videorecording]"],"format":["Video/Projected medium"],"language_code_s":[" "],"holdings_1display":"{\"5386007\":{\"call_number\":\"LF731\",\"call_number_browse\":\"LF731\",\"location\":\"ReCAP\",\"library\":\"ReCAP\",\"location_code\":\"scsbcul\",\"items\":[{\"holding_id\":\"5386007\",\"id\":\"7993731\",\"use_statement\":\"In Library Use\",\"status_at_load\":\"Available\",\"barcode\":\"MR00259012\",\"copy_number\":\"1\",\"cgc\":\"Open\",\"collection_code\":\"MR\"}]}}","recap_notes_display":["C - O"],"location_code_s":["scsbcul"],"location":["ReCAP"],"location_display":["ReCAP"],"advanced_location_s":["scsbcul","ReCAP"],"name_title_browse_s":["Lee, Spike. Do the right thing"],"call_number_display":["LF731"],"call_number_browse_s":["LF731"]}
{
"id": "SCSB-5396104",
"numeric_id_b": false,
"other_id_s": [
"6516643"
],
"author_display": [
"Lee, Spike"
],
"author_citation_display": [
"Lee, Spike"
],
"author_roles_1display": "{\"secondary_authors\":[],\"translators\":[],\"editors\":[],\"compilers\":[],\"primary_author\":\"Lee, Spike\"}",
"author_s": [
"Lee, Spike"
],
"marc_relator_display": [
"Author"
],
"title_display": "Do the right thing [videorecording]",
"title_t": [
"Do the right thing [videorecording]"
],
"title_citation_display": [
"Do the right thing"
],
"compiled_created_t": [
"Do the right thing [videorecording]"
],
"format": [
"Video/Projected medium"
],
"language_code_s": [
" "
],
"holdings_1display": "{\"5386007\":{\"call_number\":\"LF731\",\"call_number_browse\":\"LF731\",\"location\":\"ReCAP\",\"library\":\"ReCAP\",\"location_code\":\"scsbcul\",\"items\":[{\"holding_id\":\"5386007\",\"id\":\"7993731\",\"use_statement\":\"In Library Use\",\"status_at_load\":\"Available\",\"barcode\":\"MR00259012\",\"copy_number\":\"1\",\"cgc\":\"Open\",\"collection_code\":\"MR\"}]}}",
"recap_notes_display": [
"C - O"
],
"location_code_s": [
"scsbcul"
],
"location": [
"ReCAP"
],
"location_display": [
"ReCAP"
],
"advanced_location_s": [
"scsbcul",
"ReCAP"
],
"name_title_browse_s": [
"Lee, Spike. Do the right thing"
],
"call_number_display": [
"LF731"
],
"call_number_browse_s": [
"LF731"
]
}
36 changes: 19 additions & 17 deletions spec/models/requests/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -608,24 +608,26 @@
# end
# end

context "When passed an ID for a paging location in f outside of call number range" do
let(:params) do
{
system_id: '9943404133506421',
mfhd: '22514049930006421',
patron:
}
end
let(:request_at_paging_f) { described_class.new(**params) }
# Future refactoring: we are not using call numbers as a filter for paging requests
# https://github.com/pulibrary/orangelight/issues/3872
# context "When passed an ID for a paging location in f outside of call number range" do
# let(:params) do
# {
# system_id: '9943404133506421',
# mfhd: '22514049930006421',
# patron:
# }
# end
# let(:request_at_paging_f) { described_class.new(**params) }

describe "#pageable?" do
it "is be false" do
expect(request_at_paging_f.requestable[0].location_code).to eq('recap$pa')
expect(request_at_paging_f.requestable[0].charged?).to be true
expect(request_at_paging_f.requestable[0].pageable?).to be false
end
end
end
# describe "#pageable?" do
# it "is be false" do
# expect(request_at_paging_f.requestable[0].location_code).to eq('recap$pa')
# expect(request_at_paging_f.requestable[0].charged?).to be true
# expect(request_at_paging_f.requestable[0].pageable?).to be false
# end
# end
# end
# 6009363 returned
# context "When passed an ID for a paging location f within a call in a range" do
# let(:user) { FactoryBot.build(:user) }
Expand Down
22 changes: 0 additions & 22 deletions spec/models/requests/requestable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1033,28 +1033,6 @@
end
end

context 'A SCSB Item with no oclc number' do
let(:user) { FactoryBot.build(:user) }
let(:request) { FactoryBot.build(:request_scsb_no_oclc) }
let(:requestable) { request.requestable.first }

before do
stub_catalog_raw(bib_id: 'SCSB-5396104', type: 'scsb')
end

describe "#held_at_marquand_library?" do
it "is not marquand" do
expect(requestable).not_to be_held_at_marquand_library
end
end

describe "#available?" do
it "is not available" do
expect(requestable).not_to be_available
end
end
end

context 'A SCSB Item from a location with a pick-up and in library use restriction' do
let(:user) { FactoryBot.build(:user) }
let(:request) { FactoryBot.build(:request_scsb_ar) }
Expand Down

0 comments on commit a0b14ad

Please sign in to comment.