Skip to content

Commit

Permalink
Stubbed alma holdings, delivery locations; added fixture for availabi…
Browse files Browse the repository at this point in the history
…lity

# Co-authored-by: Carolyn Cole <[email protected]>
git commit -m
  • Loading branch information
regineheberlein committed Feb 12, 2024
1 parent 5cffe2e commit 9074f58
Show file tree
Hide file tree
Showing 3 changed files with 160 additions and 1 deletion.
10 changes: 9 additions & 1 deletion spec/features/requests/requests_by_patron_group_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,26 @@
RSpec.shared_examples "can request", vcr: { cassette_name: 'request_features', record: :none } do
let(:mms_id) { '9994933183506421?mfhd=22558528920006421' }
let(:user) { FactoryBot.create(:user) }
let(:username) { "netid123" }

before do
login_as user
stub_alma_holding_locations
stub_single_holding_location("recap$pa")
stub_availability_by_holding_id(bib_id:"9994933183506421", holding_id:"22558528920006421", body: true)
stub_delivery_locations
end

#failure message: Failure/Error: expect(page).to have_content 'Electronic Delivery'
#Failed to lookup your library account

it "PUL ReCAP print item" do
stub_catalog_raw(bib_id: '9994933183506421')
stub_scsb_availability(bib_id: "9994933183506421", institution_id: "PUL", barcode: '32101095798938')
scsb_url = "#{Requests::Config[:scsb_base]}/requestItem/requestItem"
stub_request(:post, scsb_url)
.with(body: hash_including(author: "", bibId: "9994933183506421", callNumber: "PJ7962.A5495 A95 2016", chapterTitle: "", deliveryLocation: "PA", emailAddress: '[email protected]', endPage: "", issue: "", itemBarcodes: ["32101095798938"], itemOwningInstitution: "PUL", patronBarcode: "22101008199999",
requestNotes: "", requestType: "RETRIEVAL", requestingInstitution: "PUL", startPage: "", titleIdentifier: "ʻAwāṭif madfūnah عواطف مدفونة", username: "jstudent", volume: ""))
requestNotes: "", requestType: "RETRIEVAL", requestingInstitution: "PUL", startPage: "", titleIdentifier: "ʻAwāṭif madfūnah عواطف مدفونة", username: username, volume: ""))
.to_return(status: 200, body: good_response, headers: {})
stub_request(:post, Requests::Config[:scsb_base])
.with(headers: { 'Accept' => '*/*' })
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"barcode": "32101095798938",
"id": "23558528910006421",
"holding_id": "22558528920006421",
"copy_number": "0",
"status": "Available",
"status_label": "Item in place",
"status_source": "base_status",
"process_type": null,
"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
}
]
129 changes: 129 additions & 0 deletions spec/fixtures/raw/9994933183506421.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"id": "9994933183506421",
"numeric_id_b": true,
"author_display": [
"Samḥān, Najāt",
"سمحان، نجاة،"
],
"author_citation_display": [
"Samḥān, Najāt"
],
"author_roles_1display": "{\"secondary_authors\":[\"سمحان، نجاة،\"],\"translators\":[],\"editors\":[],\"compilers\":[],\"primary_author\":\"Samḥān, Najāt\"}",
"author_s": [
"Samḥān, Najāt",
"سمحان، نجاة،"
],
"marc_relator_display": [
"Author"
],
"title_display": "ʻAwāṭif madfūnah / Najāt al-Samḥān.",
"title_vern_display": "عواطف مدفونة / نجاة السمحان.",
"title_t": [
"ʻAwāṭif madfūnah / Najāt al-Samḥān."
],
"title_citation_display": [
"ʻAwāṭif madfūnah",
"عواطف مدفونة"
],
"compiled_created_t": [
"ʻAwāṭif madfūnah / Najāt al-Samḥān.",
"عواطف مدفونة / نجاة السمحان."
],
"pub_created_vern_display": [
"القاهرة : دار الكتاب الحديث، 2016."
],
"pub_created_display": [
"al-Qāhirah : Dār al-Kitāb al-Ḥadīth, 2016.",
"القاهرة : دار الكتاب الحديث، 2016."
],
"pub_created_s": [
"al-Qāhirah : Dār al-Kitāb al-Ḥadīth, 2016.",
"القاهرة : دار الكتاب الحديث، 2016."
],
"pub_citation_display": [
"al-Qāhirah: Dār al-Kitāb al-Ḥadīth",
"القاهرة: دار الكتاب الحديث،"
],
"pub_date_display": [
"2016"
],
"pub_date_start_sort": 2016,
"cataloged_tdt": "2016-01-19T00:00:00Z",
"format": [
"Book"
],
"description_display": [
"230 pages ; 20 cm"
],
"description_t": [
"230 pages ; 20 cm"
],
"number_of_pages_citation_display": [
"230 pages"
],
"notes_display": [
"Short stories."
],
"language_name_display": [
"Arabic"
],
"language_facet": [
"Arabic"
],
"language_iana_s": [
"ar"
],
"lc_subject_display": [
"Short stories, Arabic—21st century"
],
"subject_facet": [
"Short stories, Arabic—21st century"
],
"isbn_display": [
"9789773506827",
"9773506827"
],
"isbn_s": [
"9789773506827"
],
"oclc_s": [
"932335821"
],
"other_version_s": [
"9789773506827",
"ocn932335821"
],
"subject_era_facet": [
"21st century"
],
"holdings_1display": "{\"22558528920006421\":{\"location_code\":\"recap$pa\",\"location\":\"Remote Storage\",\"library\":\"ReCAP\",\"call_number\":\"PJ7962.A5495 A95 2016\",\"call_number_browse\":\"PJ7962.A5495 A95 2016\",\"items\":[{\"holding_id\":\"22558528920006421\",\"id\":\"23558528910006421\",\"status_at_load\":\"1\",\"barcode\":\"32101095798938\",\"copy_number\":\"0\"}]}}",
"location_code_s": [
"recap$pa"
],
"location": [
"ReCAP"
],
"location_display": [
"Remote Storage"
],
"advanced_location_s": [
"recap$pa",
"ReCAP"
],
"name_title_browse_s": [
"Samḥān, Najāt. ʻAwāṭif madfūnah",
"سمحان، نجاة،. عواطف مدفونة"
],
"call_number_display": [
"PJ7962.A5495 A95 2016"
],
"call_number_browse_s": [
"PJ7962.A5495 A95 2016"
],
"call_number_locator_display": [
"PJ7962.A5495 A95 2016"
],
"hashed_id_ssi": "fd5824304556cdcc",
"_version_": 1773889407970967600,
"timestamp": "2023-08-11T00:12:48.249Z"
}

0 comments on commit 9074f58

Please sign in to comment.