From 91d56d1d1e0972f863856040938169c008b71288 Mon Sep 17 00:00:00 2001 From: Kristina Spurgin Date: Fri, 18 Oct 2024 21:31:40 -0400 Subject: [PATCH 1/3] Refresh test cassettes --- .../mapper/term_searchable_spec.rb | 2 +- .../cassettes/core_concept_cats_tuxedo.yml | 54 +++++++++ .../cassettes/core_nhr_ids_not_found.yml | 54 +++++++++ .../cassettes/core_oh_ids_not_found.yml | 54 +++++++++ .../datahandler_tag_unfound_terms.yml | 54 +++++++++ .../datahandler_uncached_found_terms.yml | 56 +++++++++ .../datahandler_uncached_unfound_terms.yml | 110 ++++++++++++++++++ ...andler_result_titletranslationlanguage.yml | 54 +++++++++ .../term_handler_terms_ref_multi_used.yml | 108 +++++++++++++++++ .../cassettes/term_handler_terms_sanza.yml | 54 +++++++++ ...to_all.yml => vocab_publishto_cap_all.yml} | 93 ++++++--------- ..._All.yml => vocab_publishto_lower_all.yml} | 71 +++++++---- 12 files changed, 681 insertions(+), 83 deletions(-) rename spec/support/cassettes/{vocab_publishto_all.yml => vocab_publishto_cap_all.yml} (63%) rename spec/support/cassettes/{vocab_publishto_All.yml => vocab_publishto_lower_all.yml} (76%) diff --git a/spec/collectionspace/mapper/term_searchable_spec.rb b/spec/collectionspace/mapper/term_searchable_spec.rb index c8bd9e91..a336799f 100644 --- a/spec/collectionspace/mapper/term_searchable_spec.rb +++ b/spec/collectionspace/mapper/term_searchable_spec.rb @@ -115,7 +115,7 @@ def initialize(type, subtype, handler) term.send(:searched_term, val, :refname, termtype, termsubtype) end - context "when val exists in instance", vcr: "vocab_publishto_All" do + context "when val exists in instance", vcr: "vocab_publishto_cap_all" do let(:val) { "All" } it "returns refname urn" do expected = "urn:cspace:core.collectionspace.org:vocabularies:name"\ diff --git a/spec/support/cassettes/core_concept_cats_tuxedo.yml b/spec/support/cassettes/core_concept_cats_tuxedo.yml index 0d99a96f..2b9dcc03 100644 --- a/spec/support/cassettes/core_concept_cats_tuxedo.yml +++ b/spec/support/cassettes/core_concept_cats_tuxedo.yml @@ -228,4 +228,58 @@ http_interactions: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rel="http://collectionspace.org/services/relation" xmlns:ns4="http://collectionspace.org/services/jaxb">02500subjectCsid|relationshipType|predicateDisplayName|relationshipMetaType|objectCsid|uri|csid|subject|object recorded_at: Tue, 18 Apr 2023 23:07:13 GMT +- request: + method: get + uri: https://core.dev.collectionspace.org/cspace-services/conceptauthorities/urn:cspace:name(concept)/items?as=concepts_common:conceptTermGroupList/0/termDisplayName%20ILIKE%20%27Tuxedo%20cats%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Authorization: + - Basic YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + response: + status: + code: 200 + message: '' + headers: + Date: + - Sat, 19 Oct 2024 01:25:59 GMT + Content-Type: + - application/xml + Content-Length: + - '402' + Connection: + - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=08314FB0A3AFCDDC802A656CAED92551; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + body: + encoding: UTF-8 + string: 02500csid|uri|refName|updatedAt|workflowState|rev|shortIdentifier|sas|proposed|deprecated|termStatus|termDisplayName + recorded_at: Sat, 19 Oct 2024 01:25:59 GMT recorded_with: VCR 6.1.0 diff --git a/spec/support/cassettes/core_nhr_ids_not_found.yml b/spec/support/cassettes/core_nhr_ids_not_found.yml index 12546c79..c5dc5786 100644 --- a/spec/support/cassettes/core_nhr_ids_not_found.yml +++ b/spec/support/cassettes/core_nhr_ids_not_found.yml @@ -184,4 +184,58 @@ http_interactions: string: 02500csid|uri|refName|updatedAt|workflowState|locationDate|movementReferenceNumber|currentLocation recorded_at: Wed, 19 Apr 2023 17:00:02 GMT +- request: + method: get + uri: https://core.dev.collectionspace.org/cspace-services/movements?as=movements_common:movementReferenceNumber%20ILIKE%20%27LOC%20MISSING%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Authorization: + - Basic YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + response: + status: + code: 200 + message: '' + headers: + Date: + - Sat, 19 Oct 2024 01:26:21 GMT + Content-Type: + - application/xml + Content-Length: + - '384' + Connection: + - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=C4F1F9119FF4B75785D56AEFC84DB7FF; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + body: + encoding: UTF-8 + string: 02500csid|uri|refName|updatedAt|workflowState|locationDate|movementReferenceNumber|currentLocation + recorded_at: Sat, 19 Oct 2024 01:26:21 GMT recorded_with: VCR 6.1.0 diff --git a/spec/support/cassettes/core_oh_ids_not_found.yml b/spec/support/cassettes/core_oh_ids_not_found.yml index 6699e1d8..b99330fd 100644 --- a/spec/support/cassettes/core_oh_ids_not_found.yml +++ b/spec/support/cassettes/core_oh_ids_not_found.yml @@ -182,4 +182,58 @@ http_interactions: string: 02500csid|uri|refName|updatedAt|workflowState|objectNumber|objectName|title|responsibleDepartment recorded_at: Wed, 19 Apr 2023 16:12:28 GMT +- request: + method: get + uri: https://core.dev.collectionspace.org/cspace-services/collectionobjects?as=collectionobjects_common:objectNumber%20ILIKE%20%27MISSING%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Authorization: + - Basic YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + response: + status: + code: 200 + message: '' + headers: + Date: + - Sat, 19 Oct 2024 01:26:21 GMT + Content-Type: + - application/xml + Content-Length: + - '383' + Connection: + - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=281884314493F1BC693EA342A3738445; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + body: + encoding: UTF-8 + string: 02500csid|uri|refName|updatedAt|workflowState|objectNumber|objectName|title|responsibleDepartment + recorded_at: Sat, 19 Oct 2024 01:26:21 GMT recorded_with: VCR 6.1.0 diff --git a/spec/support/cassettes/datahandler_tag_unfound_terms.yml b/spec/support/cassettes/datahandler_tag_unfound_terms.yml index d907ee31..394cfa01 100644 --- a/spec/support/cassettes/datahandler_tag_unfound_terms.yml +++ b/spec/support/cassettes/datahandler_tag_unfound_terms.yml @@ -410,4 +410,58 @@ http_interactions: string: 02500csid|uri|refName|updatedAt|workflowState|objectNumber|objectName|title|responsibleDepartment recorded_at: Tue, 18 Apr 2023 23:22:27 GMT +- request: + method: get + uri: https://core.dev.collectionspace.org/cspace-services/conceptauthorities/urn:cspace:name(concept)/items?as=concepts_common:conceptTermGroupList/0/termDisplayName%20ILIKE%20%27Birbs%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Authorization: + - Basic YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + response: + status: + code: 200 + message: '' + headers: + Date: + - Sat, 19 Oct 2024 01:26:00 GMT + Content-Type: + - application/xml + Content-Length: + - '402' + Connection: + - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=35831C3DCD9E997A8F94780C48AE27DA; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + body: + encoding: UTF-8 + string: 02500csid|uri|refName|updatedAt|workflowState|rev|shortIdentifier|sas|proposed|deprecated|termStatus|termDisplayName + recorded_at: Sat, 19 Oct 2024 01:26:00 GMT recorded_with: VCR 6.1.0 diff --git a/spec/support/cassettes/datahandler_uncached_found_terms.yml b/spec/support/cassettes/datahandler_uncached_found_terms.yml index 0ffefb03..fa6ba14d 100644 --- a/spec/support/cassettes/datahandler_uncached_found_terms.yml +++ b/spec/support/cassettes/datahandler_uncached_found_terms.yml @@ -229,4 +229,60 @@ http_interactions: string: 02500csid|uri|refName|updatedAt|workflowState|objectNumber|objectName|title|responsibleDepartment recorded_at: Tue, 18 Apr 2023 23:22:28 GMT +- request: + method: get + uri: https://core.dev.collectionspace.org/cspace-services/workauthorities/urn:cspace:name(work)/items?as=works_common:workTermGroupList/0/termDisplayName%20ILIKE%20%27Test%20Collection%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Authorization: + - Basic YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + response: + status: + code: 200 + message: '' + headers: + Date: + - Sat, 19 Oct 2024 01:26:01 GMT + Content-Type: + - application/xml + Content-Length: + - '929' + Connection: + - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=7B4FB810670FEEA6CBE2C3019BB26C06; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + body: + encoding: UTF-8 + string: 02511csid|uri|refName|updatedAt|workflowState|rev|shortIdentifier|sas|proposed|deprecated|termStatus|termDisplayNamea400dae6-ea36-4b60-8934/workauthorities/f4c31435-f038-42ef-91f6/items/a400dae6-ea36-4b60-8934urn:cspace:core.collectionspace.org:workauthorities:name(work):item:name(Testcollection1729299104018)'Test + collection'2024-10-19T00:51:44.018Zproject0Testcollection1729299104018falsetrueTest + collection + recorded_at: Sat, 19 Oct 2024 01:26:01 GMT recorded_with: VCR 6.1.0 diff --git a/spec/support/cassettes/datahandler_uncached_unfound_terms.yml b/spec/support/cassettes/datahandler_uncached_unfound_terms.yml index db8756f9..373bcae6 100644 --- a/spec/support/cassettes/datahandler_uncached_unfound_terms.yml +++ b/spec/support/cassettes/datahandler_uncached_unfound_terms.yml @@ -320,4 +320,114 @@ http_interactions: string: 02500csid|uri|refName|updatedAt|workflowState|objectNumber|objectName|title|responsibleDepartment recorded_at: Tue, 18 Apr 2023 23:22:27 GMT +- request: + method: get + uri: https://core.dev.collectionspace.org/cspace-services/workauthorities/urn:cspace:name(work)/items?as=works_common:workTermGroupList/0/termDisplayName%20ILIKE%20%27Test%20collection%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Authorization: + - Basic YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + response: + status: + code: 200 + message: '' + headers: + Date: + - Sat, 19 Oct 2024 01:26:01 GMT + Content-Type: + - application/xml + Content-Length: + - '929' + Connection: + - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=60F174B1991B7FDF791E757B45FEA52C; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + body: + encoding: UTF-8 + string: 02511csid|uri|refName|updatedAt|workflowState|rev|shortIdentifier|sas|proposed|deprecated|termStatus|termDisplayNamea400dae6-ea36-4b60-8934/workauthorities/f4c31435-f038-42ef-91f6/items/a400dae6-ea36-4b60-8934urn:cspace:core.collectionspace.org:workauthorities:name(work):item:name(Testcollection1729299104018)'Test + collection'2024-10-19T00:51:44.018Zproject0Testcollection1729299104018falsetrueTest + collection + recorded_at: Sat, 19 Oct 2024 01:26:01 GMT +- request: + method: get + uri: https://core.dev.collectionspace.org/cspace-services/vocabularies/urn:cspace:name(languages)/items?as=vocabularyitems_common:displayName%20ILIKE%20%27Klingon%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Authorization: + - Basic YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + response: + status: + code: 200 + message: '' + headers: + Date: + - Sat, 19 Oct 2024 01:26:01 GMT + Content-Type: + - application/xml + Content-Length: + - '445' + Connection: + - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=9574A56487F5DAC39C7B5E97688C5E68; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + body: + encoding: UTF-8 + string: 02500csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|referenced|deprecated|termStatus|description|source|order|displayName|shortIdentifier + recorded_at: Sat, 19 Oct 2024 01:26:01 GMT recorded_with: VCR 6.1.0 diff --git a/spec/support/cassettes/term_handler_result_titletranslationlanguage.yml b/spec/support/cassettes/term_handler_result_titletranslationlanguage.yml index e0952ded..37dc0c34 100644 --- a/spec/support/cassettes/term_handler_result_titletranslationlanguage.yml +++ b/spec/support/cassettes/term_handler_result_titletranslationlanguage.yml @@ -137,4 +137,58 @@ http_interactions: string: 02500csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|referenced|deprecated|termStatus|description|source|order|displayName|shortIdentifier recorded_at: Sun, 16 Apr 2023 19:48:10 GMT +- request: + method: get + uri: https://core.dev.collectionspace.org/cspace-services/vocabularies/urn:cspace:name(languages)/items?as=vocabularyitems_common:displayName%20ILIKE%20%27Klingon%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Authorization: + - Basic YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + response: + status: + code: 200 + message: '' + headers: + Date: + - Sat, 19 Oct 2024 01:26:24 GMT + Content-Type: + - application/xml + Content-Length: + - '445' + Connection: + - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=11CBFD8B9E6137974A521EAD51C9A1F4; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + body: + encoding: UTF-8 + string: 02500csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|referenced|deprecated|termStatus|description|source|order|displayName|shortIdentifier + recorded_at: Sat, 19 Oct 2024 01:26:24 GMT recorded_with: VCR 6.1.0 diff --git a/spec/support/cassettes/term_handler_terms_ref_multi_used.yml b/spec/support/cassettes/term_handler_terms_ref_multi_used.yml index ec4b5110..784d97c1 100644 --- a/spec/support/cassettes/term_handler_terms_ref_multi_used.yml +++ b/spec/support/cassettes/term_handler_terms_ref_multi_used.yml @@ -227,4 +227,112 @@ http_interactions: string: 02500csid|uri|refName|updatedAt|workflowState|rev|shortIdentifier|sas|proposed|deprecated|termStatus|termDisplayName recorded_at: Sun, 16 Apr 2023 19:48:08 GMT +- request: + method: get + uri: https://core.dev.collectionspace.org/cspace-services/citationauthorities/urn:cspace:name(citation)/items?as=citations_common:citationTermGroupList/0/termDisplayName%20ILIKE%20%27Reference%203%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Authorization: + - Basic YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + response: + status: + code: 200 + message: '' + headers: + Date: + - Sat, 19 Oct 2024 01:26:24 GMT + Content-Type: + - application/xml + Content-Length: + - '402' + Connection: + - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=2ABA8F77C475C49EE5A05B9D608075F9; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + body: + encoding: UTF-8 + string: 02500csid|uri|refName|updatedAt|workflowState|rev|shortIdentifier|sas|proposed|deprecated|termStatus|termDisplayName + recorded_at: Sat, 19 Oct 2024 01:26:24 GMT +- request: + method: get + uri: https://core.dev.collectionspace.org/cspace-services/citationauthorities/urn:cspace:name(citation)/items?as=citations_common:citationTermGroupList/0/termDisplayName%20ILIKE%20%27Reference%204%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Authorization: + - Basic YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + response: + status: + code: 200 + message: '' + headers: + Date: + - Sat, 19 Oct 2024 01:26:24 GMT + Content-Type: + - application/xml + Content-Length: + - '402' + Connection: + - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=5D714B861A68A88B0B3A429FCF55F83E; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + body: + encoding: UTF-8 + string: 02500csid|uri|refName|updatedAt|workflowState|rev|shortIdentifier|sas|proposed|deprecated|termStatus|termDisplayName + recorded_at: Sat, 19 Oct 2024 01:26:24 GMT recorded_with: VCR 6.1.0 diff --git a/spec/support/cassettes/term_handler_terms_sanza.yml b/spec/support/cassettes/term_handler_terms_sanza.yml index 74c162b8..ea4eeb97 100644 --- a/spec/support/cassettes/term_handler_terms_sanza.yml +++ b/spec/support/cassettes/term_handler_terms_sanza.yml @@ -137,4 +137,58 @@ http_interactions: string: 02500csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|referenced|deprecated|termStatus|description|source|order|displayName|shortIdentifier recorded_at: Sun, 16 Apr 2023 19:48:09 GMT +- request: + method: get + uri: https://core.dev.collectionspace.org/cspace-services/vocabularies/urn:cspace:name(languages)/items?as=vocabularyitems_common:displayName%20ILIKE%20%27Sanza%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Authorization: + - Basic YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + response: + status: + code: 200 + message: '' + headers: + Date: + - Sat, 19 Oct 2024 01:26:25 GMT + Content-Type: + - application/xml + Content-Length: + - '445' + Connection: + - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=D1EE547633198BB199E4F6FE354641EE; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + body: + encoding: UTF-8 + string: 02500csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|referenced|deprecated|termStatus|description|source|order|displayName|shortIdentifier + recorded_at: Sat, 19 Oct 2024 01:26:25 GMT recorded_with: VCR 6.1.0 diff --git a/spec/support/cassettes/vocab_publishto_all.yml b/spec/support/cassettes/vocab_publishto_cap_all.yml similarity index 63% rename from spec/support/cassettes/vocab_publishto_all.yml rename to spec/support/cassettes/vocab_publishto_cap_all.yml index 8e2c75e8..42b35794 100644 --- a/spec/support/cassettes/vocab_publishto_all.yml +++ b/spec/support/cassettes/vocab_publishto_cap_all.yml @@ -21,77 +21,41 @@ http_interactions: message: '' headers: Date: - - Sun, 27 Aug 2023 01:58:17 GMT + - Sat, 19 Oct 2024 01:21:29 GMT Content-Type: - application/xml Content-Length: - - '804' + - '805' Connection: - keep-alive - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Pragma: - - no-cache - Expires: - - '0' - X-Xss-Protection: - - 1; mode=block - X-Frame-Options: - - DENY + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=DCB86D83F09C2C98F47F30B060EFC1CC; Path=/cspace-services; Secure; + HttpOnly X-Content-Type-Options: - nosniff - body: - encoding: UTF-8 - string: 0112csid|uri|refName|updatedAt|workflowState|rev|shortIdentifier|sas|displayName|vocabType4bea28cb-83be-4ca1-971b/personauthorities/4bea28cb-83be-4ca1-971burn:cspace:core.collectionspace.org:personauthorities:name(person)'Local - Persons'2023-08-26T02:44:37.565Zproject0personLocal - PersonsPersonAuthority - recorded_at: Sun, 27 Aug 2023 01:58:17 GMT -- request: - method: get - uri: https://core.dev.collectionspace.org/cspace-services/vocabularies/urn:cspace:name(publishto)/items?as=vocabularyitems_common:displayName%20=%20%27all%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false - body: - encoding: US-ASCII - string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby - Authorization: - - Basic YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= - response: - status: - code: 200 - message: '' - headers: - Date: - - Sun, 27 Aug 2023 01:58:17 GMT - Content-Type: - - application/xml - Content-Length: - - '445' - Connection: - - keep-alive + X-Xss-Protection: + - 1; mode=block Cache-Control: - no-cache, no-store, max-age=0, must-revalidate Pragma: - no-cache Expires: - '0' - X-Xss-Protection: - - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains X-Frame-Options: - DENY - X-Content-Type-Options: - - nosniff body: encoding: UTF-8 string: 02500csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|referenced|deprecated|termStatus|description|source|order|displayName|shortIdentifier - recorded_at: Sun, 27 Aug 2023 01:58:17 GMT + xmlns:ns2="http://collectionspace.org/services/jaxb">0112csid|uri|refName|updatedAt|workflowState|rev|shortIdentifier|sas|displayName|vocabType4bea28cb-83be-4ca1-971b/personauthorities/4bea28cb-83be-4ca1-971burn:cspace:core.collectionspace.org:personauthorities:name(person)'Local + Persons'2023-08-26T05:44:37.565Zproject13personLocal + PersonsPersonAuthority + recorded_at: Sat, 19 Oct 2024 01:21:29 GMT - request: method: get uri: https://core.dev.collectionspace.org/cspace-services/vocabularies/urn:cspace:name(publishto)/items?as=vocabularyitems_common:displayName%20=%20%27All%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false @@ -113,28 +77,37 @@ http_interactions: message: '' headers: Date: - - Sun, 27 Aug 2023 01:58:18 GMT + - Sat, 19 Oct 2024 01:21:29 GMT Content-Type: - application/xml Content-Length: - '891' Connection: - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=7AB5F4FD505E68D9D1EA5F625F2BC12D; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block Cache-Control: - no-cache, no-store, max-age=0, must-revalidate Pragma: - no-cache Expires: - '0' - X-Xss-Protection: - - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains X-Frame-Options: - DENY - X-Content-Type-Options: - - nosniff body: encoding: UTF-8 string: 02511csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|referenced|deprecated|termStatus|description|source|order|displayName|shortIdentifier1be6baa8-3691-4fad-bf01/vocabularies/8fd03497-36d2-4d91-a46b/items/1be6baa8-3691-4fad-bf01urn:cspace:core.collectionspace.org:vocabularies:name(publishto):item:name(all)'All'2023-08-26T02:43:29.142Zproject0falsetrueAllall - recorded_at: Sun, 27 Aug 2023 01:58:18 GMT + xmlns:ns2="http://collectionspace.org/services/jaxb">02511csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|referenced|deprecated|termStatus|description|source|order|displayName|shortIdentifier1be6baa8-3691-4fad-bf01/vocabularies/8fd03497-36d2-4d91-a46b/items/1be6baa8-3691-4fad-bf01urn:cspace:core.collectionspace.org:vocabularies:name(publishto):item:name(all)'All'2023-08-26T05:43:29.142Zproject0falsetrueAllall + recorded_at: Sat, 19 Oct 2024 01:21:29 GMT recorded_with: VCR 6.1.0 diff --git a/spec/support/cassettes/vocab_publishto_All.yml b/spec/support/cassettes/vocab_publishto_lower_all.yml similarity index 76% rename from spec/support/cassettes/vocab_publishto_All.yml rename to spec/support/cassettes/vocab_publishto_lower_all.yml index 8e2c75e8..2f23ae96 100644 --- a/spec/support/cassettes/vocab_publishto_All.yml +++ b/spec/support/cassettes/vocab_publishto_lower_all.yml @@ -21,32 +21,41 @@ http_interactions: message: '' headers: Date: - - Sun, 27 Aug 2023 01:58:17 GMT + - Sat, 19 Oct 2024 01:21:28 GMT Content-Type: - application/xml Content-Length: - - '804' + - '805' Connection: - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=25DF30A8318B186D8EBCF2B8F5368A65; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block Cache-Control: - no-cache, no-store, max-age=0, must-revalidate Pragma: - no-cache Expires: - '0' - X-Xss-Protection: - - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains X-Frame-Options: - DENY - X-Content-Type-Options: - - nosniff body: encoding: UTF-8 string: 0112csid|uri|refName|updatedAt|workflowState|rev|shortIdentifier|sas|displayName|vocabType4bea28cb-83be-4ca1-971b/personauthorities/4bea28cb-83be-4ca1-971burn:cspace:core.collectionspace.org:personauthorities:name(person)'Local - Persons'2023-08-26T02:44:37.565Zproject0personLocal + Persons'2023-08-26T05:44:37.565Zproject13personLocal PersonsPersonAuthority - recorded_at: Sun, 27 Aug 2023 01:58:17 GMT + recorded_at: Sat, 19 Oct 2024 01:21:28 GMT - request: method: get uri: https://core.dev.collectionspace.org/cspace-services/vocabularies/urn:cspace:name(publishto)/items?as=vocabularyitems_common:displayName%20=%20%27all%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false @@ -68,33 +77,42 @@ http_interactions: message: '' headers: Date: - - Sun, 27 Aug 2023 01:58:17 GMT + - Sat, 19 Oct 2024 01:21:29 GMT Content-Type: - application/xml Content-Length: - '445' Connection: - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=88FA077D996907CA9425B1A58CF2A4B4; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block Cache-Control: - no-cache, no-store, max-age=0, must-revalidate Pragma: - no-cache Expires: - '0' - X-Xss-Protection: - - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains X-Frame-Options: - DENY - X-Content-Type-Options: - - nosniff body: encoding: UTF-8 string: 02500csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|referenced|deprecated|termStatus|description|source|order|displayName|shortIdentifier - recorded_at: Sun, 27 Aug 2023 01:58:17 GMT + recorded_at: Sat, 19 Oct 2024 01:21:29 GMT - request: method: get - uri: https://core.dev.collectionspace.org/cspace-services/vocabularies/urn:cspace:name(publishto)/items?as=vocabularyitems_common:displayName%20=%20%27All%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false + uri: https://core.dev.collectionspace.org/cspace-services/vocabularies/urn:cspace:name(publishto)/items?as=vocabularyitems_common:displayName%20ILIKE%20%27all%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false body: encoding: US-ASCII string: '' @@ -113,28 +131,37 @@ http_interactions: message: '' headers: Date: - - Sun, 27 Aug 2023 01:58:18 GMT + - Sat, 19 Oct 2024 01:21:29 GMT Content-Type: - application/xml Content-Length: - '891' Connection: - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=966DB39F7A5F200001AC53313B3B27EA; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block Cache-Control: - no-cache, no-store, max-age=0, must-revalidate Pragma: - no-cache Expires: - '0' - X-Xss-Protection: - - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains X-Frame-Options: - DENY - X-Content-Type-Options: - - nosniff body: encoding: UTF-8 string: 02511csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|referenced|deprecated|termStatus|description|source|order|displayName|shortIdentifier1be6baa8-3691-4fad-bf01/vocabularies/8fd03497-36d2-4d91-a46b/items/1be6baa8-3691-4fad-bf01urn:cspace:core.collectionspace.org:vocabularies:name(publishto):item:name(all)'All'2023-08-26T02:43:29.142Zproject0falsetrueAllall - recorded_at: Sun, 27 Aug 2023 01:58:18 GMT + xmlns:ns2="http://collectionspace.org/services/jaxb">02511csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|referenced|deprecated|termStatus|description|source|order|displayName|shortIdentifier1be6baa8-3691-4fad-bf01/vocabularies/8fd03497-36d2-4d91-a46b/items/1be6baa8-3691-4fad-bf01urn:cspace:core.collectionspace.org:vocabularies:name(publishto):item:name(all)'All'2023-08-26T05:43:29.142Zproject0falsetrueAllall + recorded_at: Sat, 19 Oct 2024 01:21:29 GMT recorded_with: VCR 6.1.0 From 34b38d764b4aa842f2a5346e1cb0d1d9bd8988b9 Mon Sep 17 00:00:00 2001 From: Kristina Spurgin Date: Fri, 18 Oct 2024 21:07:34 -0400 Subject: [PATCH 2/3] Implement fully case insensitive fallback term search Only triggered if exact search returns no results. Sends ILIKE operator through to client.find --- lib/collectionspace/mapper/searcher.rb | 29 ++- lib/collectionspace/mapper/term_searchable.rb | 16 +- spec/collectionspace/mapper/searcher_spec.rb | 60 ++++--- .../mapper/term_searchable_spec.rb | 12 +- .../cassettes/searcher_ci_authority.yml | 167 ++++++++++++++++++ spec/support/cassettes/searcher_ci_vocab.yml | 167 ++++++++++++++++++ 6 files changed, 409 insertions(+), 42 deletions(-) create mode 100644 spec/support/cassettes/searcher_ci_authority.yml create mode 100644 spec/support/cassettes/searcher_ci_vocab.yml diff --git a/lib/collectionspace/mapper/searcher.rb b/lib/collectionspace/mapper/searcher.rb index 15edfcda..2127b2c9 100644 --- a/lib/collectionspace/mapper/searcher.rb +++ b/lib/collectionspace/mapper/searcher.rb @@ -21,16 +21,13 @@ def call(value:, type:, subtype: nil) attr_reader :client, :active, :search_fields - def case_swap(string) - string.match?(/[A-Z]/) ? string.downcase : string.capitalize - end - - def get_response(value, type, subtype) + def get_response(value, type, subtype, operator = "=") response = client.find( type: type, subtype: subtype, value: value, - field: search_field(type) + field: search_field(type), + operator: operator ) rescue => e puts e.message @@ -50,6 +47,10 @@ def lookup_search_field(type) def parse_response(response) parsed = response.parsed["abstract_common_list"] + return parsed if parsed["list_item"].is_a?(Array) + + parsed["list_item"] = [parsed["list_item"]] + parsed rescue => e puts e.message nil @@ -83,7 +84,21 @@ def search_response(value, type, subtype) as_is = get_response(value, type, subtype) return as_is if response_usable?(as_is) - get_response(case_swap(value), type, subtype) + case_insensitive_response(value, type, subtype) + end + + def case_insensitive_response(value, type, subtype) + response = get_response(value, type, subtype, "ILIKE") + return nil unless response_usable?(response) + + displayname = response.dig("list_item", 0, "displayName") || + response.dig("list_item", 0, "termDisplayName") + warning = { + category: "case_insensitive_match", + message: "Searched: #{value}. Using: #{displayname}" + } + response["warnings"] = [warning] + response end end end diff --git a/lib/collectionspace/mapper/term_searchable.rb b/lib/collectionspace/mapper/term_searchable.rb index d97b5c30..0def4229 100644 --- a/lib/collectionspace/mapper/term_searchable.rb +++ b/lib/collectionspace/mapper/term_searchable.rb @@ -194,13 +194,20 @@ def rec_from_response(category, val, apiresponse) end def return_record(category, val, apiresponse, term_ct) + rec = apiresponse["list_item"][0] + case term_ct when 0 - rec = nil + nil when 1 - rec = apiresponse["list_item"] + if apiresponse.key?("warnings") + apiresponse["warnings"].each do |warning| + response.add_warning(warning.merge({field: column})) + end + end + rec + # rec = apiresponse["list_item"] else - rec = apiresponse["list_item"][0] using_uri = "#{client.config.base_uri}#{rec["uri"]}" response.add_warning({ category: :"multiple_records_found_for_#{category}", @@ -210,9 +217,8 @@ def return_record(category, val, apiresponse, term_ct) value: val, message: "#{term_ct} records found. Using #{using_uri}" }) + rec end - - rec end def add_bad_lookup_error(category, val) diff --git a/spec/collectionspace/mapper/searcher_spec.rb b/spec/collectionspace/mapper/searcher_spec.rb index d97f34d2..2f21a348 100644 --- a/spec/collectionspace/mapper/searcher_spec.rb +++ b/spec/collectionspace/mapper/searcher_spec.rb @@ -15,44 +15,48 @@ describe "#.call", vcr: "core_domain_check" do let(:result) { searcher.call(**args) } - let(:args) { {value: "All", type: "vocabularies", subtype: "publishto"} } + let(:args) { {value: value, type: "vocabularies", subtype: "publishto"} } context "when search_if_not_cached = true", vcr: "searcher_search" do let(:config) { {} } + let(:value) { "All" } it "returns expected hash" do - expected = { - "fieldsReturned" => - "csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|"\ - "proposed|referenced|deprecated|termStatus|description|source|"\ - "order|displayName|shortIdentifier", - "itemsInPage" => "1", - "list_item" => { - "csid" => "d614ebc5-96fd-4680-9727", - "displayName" => "All", - "proposed" => "true", - "refName" => - "urn:cspace:core.collectionspace.org:vocabularies:name"\ - "(publishto):item:name(all)'All'", - "rev" => "0", - "sas" => "false", - "shortIdentifier" => "all", - "updatedAt" => "2020-02-08T03:30:26.054Z", - "uri" => - "/vocabularies/e2ea6ca3-4c60-427d-96e5/items/"\ - "d614ebc5-96fd-4680-9727", - "workflowState" => "project" - }, - "pageNum" => "0", - "pageSize" => "25", - "totalItems" => "1" - } - expect(result).to eq(expected) + expect(result["totalItems"]).to eq("1") + expect(result.dig("list_item", 0, "displayName")).to eq("All") + end + + context "when term not matching case sensitively" do + context "when vocabulary", vcr: "searcher_ci_vocab" do + let(:value) { "alL" } + + it "returns expected hash" do + expect(result.key?("warnings")).to be true + warning = result["warnings"].first + expect(warning[:category]).to eq("case_insensitive_match") + expect(warning[:message]).to eq("Searched: #{value}. Using: All") + end + end + + context "when authority", vcr: "searcher_ci_authority" do + let(:value) { "Art" } + let(:args) do + {value: value, type: "conceptauthorities", subtype: "concept"} + end + + it "returns expected hash" do + expect(result.key?("warnings")).to be true + warning = result["warnings"].first + expect(warning[:category]).to eq("case_insensitive_match") + expect(warning[:message]).to eq("Searched: #{value}. Using: art") + end + end end end context "when search_if_not_cached = false" do let(:config) { {search_if_not_cached: false} } + let(:value) { "All" } it "returns nil" do expect(result).to be_nil diff --git a/spec/collectionspace/mapper/term_searchable_spec.rb b/spec/collectionspace/mapper/term_searchable_spec.rb index a336799f..d5476906 100644 --- a/spec/collectionspace/mapper/term_searchable_spec.rb +++ b/spec/collectionspace/mapper/term_searchable_spec.rb @@ -7,13 +7,16 @@ class TermClass include CollectionSpace::Mapper::TermSearchable - attr_reader :type, :subtype, :handler + attr_reader :type, :subtype, :handler, :response def initialize(type, subtype, handler) @type = type @subtype = subtype @handler = handler + @response = CollectionSpace::Mapper::Response.new({}, handler) @errors = [] end + + def column = "foo" end RSpec.describe CollectionSpace::Mapper::TermSearchable, @@ -125,12 +128,17 @@ def initialize(type, subtype, handler) end context "when case-swapped val exists in instance", - vcr: "vocab_publishto_all" do + vcr: "vocab_publishto_lower_all" do let(:val) { "all" } it "returns refname urn" do expected = "urn:cspace:core.collectionspace.org:vocabularies:name"\ "(publishto):item:name(all)'All'" expect(result).to eq(expected) + expect(term.response.warnings).to include({ + category: "case_insensitive_match", + message: "Searched: all. Using: All", + field: "foo" + }) end end end diff --git a/spec/support/cassettes/searcher_ci_authority.yml b/spec/support/cassettes/searcher_ci_authority.yml new file mode 100644 index 00000000..c74d01ac --- /dev/null +++ b/spec/support/cassettes/searcher_ci_authority.yml @@ -0,0 +1,167 @@ +--- +http_interactions: +- request: + method: get + uri: https://core.dev.collectionspace.org/cspace-services/personauthorities?pgNum=0&pgSz=1&wf_deleted=false + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Authorization: + - Basic YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + response: + status: + code: 200 + message: '' + headers: + Date: + - Sat, 19 Oct 2024 00:12:24 GMT + Content-Type: + - application/xml + Content-Length: + - '805' + Connection: + - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=FEBAA20BE92073180EE63DDEC3490877; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + body: + encoding: UTF-8 + string: 0112csid|uri|refName|updatedAt|workflowState|rev|shortIdentifier|sas|displayName|vocabType4bea28cb-83be-4ca1-971b/personauthorities/4bea28cb-83be-4ca1-971burn:cspace:core.collectionspace.org:personauthorities:name(person)'Local + Persons'2023-08-26T05:44:37.565Zproject13personLocal + PersonsPersonAuthority + recorded_at: Sat, 19 Oct 2024 00:12:24 GMT +- request: + method: get + uri: https://core.dev.collectionspace.org/cspace-services/conceptauthorities/urn:cspace:name(concept)/items?as=concepts_common:conceptTermGroupList/0/termDisplayName%20=%20%27Art%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Authorization: + - Basic YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + response: + status: + code: 200 + message: '' + headers: + Date: + - Sat, 19 Oct 2024 00:12:25 GMT + Content-Type: + - application/xml + Content-Length: + - '402' + Connection: + - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=A5EB36E7ED1BEEB2C121BD38D3CFD55A; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + body: + encoding: UTF-8 + string: 02500csid|uri|refName|updatedAt|workflowState|rev|shortIdentifier|sas|proposed|deprecated|termStatus|termDisplayName + recorded_at: Sat, 19 Oct 2024 00:12:25 GMT +- request: + method: get + uri: https://core.dev.collectionspace.org/cspace-services/conceptauthorities/urn:cspace:name(concept)/items?as=concepts_common:conceptTermGroupList/0/termDisplayName%20ILIKE%20%27Art%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Authorization: + - Basic YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + response: + status: + code: 200 + message: '' + headers: + Date: + - Sat, 19 Oct 2024 00:12:25 GMT + Content-Type: + - application/xml + Content-Length: + - '892' + Connection: + - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=CF61C02A1720ED8CFAE1B82E1F0C7CFE; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + body: + encoding: UTF-8 + string: 02511csid|uri|refName|updatedAt|workflowState|rev|shortIdentifier|sas|proposed|deprecated|termStatus|termDisplayName69b1a466-0c91-4baf-868c/conceptauthorities/92e3f0a0-2fa2-4ecb-a3f7/items/69b1a466-0c91-4baf-868curn:cspace:core.collectionspace.org:conceptauthorities:name(concept):item:name(art1729294383466)'art'2024-10-18T23:33:03.465Zproject0art1729294383466falsetrueart + recorded_at: Sat, 19 Oct 2024 00:12:25 GMT +recorded_with: VCR 6.1.0 diff --git a/spec/support/cassettes/searcher_ci_vocab.yml b/spec/support/cassettes/searcher_ci_vocab.yml new file mode 100644 index 00000000..b2e47791 --- /dev/null +++ b/spec/support/cassettes/searcher_ci_vocab.yml @@ -0,0 +1,167 @@ +--- +http_interactions: +- request: + method: get + uri: https://core.dev.collectionspace.org/cspace-services/personauthorities?pgNum=0&pgSz=1&wf_deleted=false + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Authorization: + - Basic YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + response: + status: + code: 200 + message: '' + headers: + Date: + - Sat, 19 Oct 2024 00:09:32 GMT + Content-Type: + - application/xml + Content-Length: + - '805' + Connection: + - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=E723F5E64299E095C333FC7B57C0EB1E; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + body: + encoding: UTF-8 + string: 0112csid|uri|refName|updatedAt|workflowState|rev|shortIdentifier|sas|displayName|vocabType4bea28cb-83be-4ca1-971b/personauthorities/4bea28cb-83be-4ca1-971burn:cspace:core.collectionspace.org:personauthorities:name(person)'Local + Persons'2023-08-26T05:44:37.565Zproject13personLocal + PersonsPersonAuthority + recorded_at: Sat, 19 Oct 2024 00:09:32 GMT +- request: + method: get + uri: https://core.dev.collectionspace.org/cspace-services/vocabularies/urn:cspace:name(publishto)/items?as=vocabularyitems_common:displayName%20=%20%27alL%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Authorization: + - Basic YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + response: + status: + code: 200 + message: '' + headers: + Date: + - Sat, 19 Oct 2024 00:09:33 GMT + Content-Type: + - application/xml + Content-Length: + - '445' + Connection: + - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=5703A73AE43342059484EF6DE4077EF0; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + body: + encoding: UTF-8 + string: 02500csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|referenced|deprecated|termStatus|description|source|order|displayName|shortIdentifier + recorded_at: Sat, 19 Oct 2024 00:09:33 GMT +- request: + method: get + uri: https://core.dev.collectionspace.org/cspace-services/vocabularies/urn:cspace:name(publishto)/items?as=vocabularyitems_common:displayName%20ILIKE%20%27alL%27&pgSz=25&sortBy=collectionspace_core:updatedAt%20DESC&wf_deleted=false + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Authorization: + - Basic YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + response: + status: + code: 200 + message: '' + headers: + Date: + - Sat, 19 Oct 2024 00:09:33 GMT + Content-Type: + - application/xml + Content-Length: + - '891' + Connection: + - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + Set-Cookie: + - JSESSIONID=12AC3BF6A209CF8FC3622F4212CF4258; Path=/cspace-services; Secure; + HttpOnly + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + body: + encoding: UTF-8 + string: 02511csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|referenced|deprecated|termStatus|description|source|order|displayName|shortIdentifier1be6baa8-3691-4fad-bf01/vocabularies/8fd03497-36d2-4d91-a46b/items/1be6baa8-3691-4fad-bf01urn:cspace:core.collectionspace.org:vocabularies:name(publishto):item:name(all)'All'2023-08-26T05:43:29.142Zproject0falsetrueAllall + recorded_at: Sat, 19 Oct 2024 00:09:33 GMT +recorded_with: VCR 6.1.0 From 136d8b5defbfaeda5fbf0c82e2046eef15dc8f6c Mon Sep 17 00:00:00 2001 From: Kristina Spurgin Date: Mon, 21 Oct 2024 09:26:20 -0400 Subject: [PATCH 3/3] Release 6.0.4 --- CHANGELOG.md | 3 +++ Gemfile.lock | 2 +- lib/collectionspace/mapper/version.rb | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40862ea5..0de7e060 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ This project bumps the version number for any changes (including documentation u ## [Unreleased] - i.e. pushed to main branch but not yet tagged as a release +## [6.0.4] - 2024-10-21 +- Make fallback term search fully case-insensitive, rather than just capitalizing/downcasing first letter of term + ## [6.0.3] - 2024-10-18 - BUGFIX: Rescue error when record status check finds more than one matching record, and add to Response errors for handling by ingest application diff --git a/Gemfile.lock b/Gemfile.lock index f3965a9b..9bec069e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,7 +12,7 @@ GIT PATH remote: . specs: - collectionspace-mapper (6.0.3) + collectionspace-mapper (6.0.4) activesupport (= 6.0.4.7) chronic collectionspace-client (~> 0.15.0) diff --git a/lib/collectionspace/mapper/version.rb b/lib/collectionspace/mapper/version.rb index 68df9526..760b42a6 100644 --- a/lib/collectionspace/mapper/version.rb +++ b/lib/collectionspace/mapper/version.rb @@ -2,6 +2,6 @@ module CollectionSpace module Mapper - VERSION = "6.0.3" + VERSION = "6.0.4" end end