From 2310876e93e0aac912f031f5bf6400017eed716e Mon Sep 17 00:00:00 2001 From: rladdusaw Date: Mon, 15 Jul 2024 16:09:00 -0400 Subject: [PATCH] Update staff url to new format (#246) * Update staff url to new format * actually replace and downcase url * escaping url for special characters --------- Co-authored-by: Ryan Laddusaw --- app/models/library_staff_document.rb | 5 ++++- spec/requests/library_staff_spec.rb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/models/library_staff_document.rb b/app/models/library_staff_document.rb index 95d7be4..aa73a2c 100644 --- a/app/models/library_staff_document.rb +++ b/app/models/library_staff_document.rb @@ -82,7 +82,10 @@ def type def description; end def url - "https://library.princeton.edu/staff/#{document.netid}" + staff_url = "https://library.psb-prod.princeton.edu/people/#{document.first_name}-#{document.last_name}" + .gsub(' ', '-') + .downcase + URI::Parser.new.escape(staff_url) end def doc_keys diff --git a/spec/requests/library_staff_spec.rb b/spec/requests/library_staff_spec.rb index aa4c64d..452c148 100644 --- a/spec/requests/library_staff_spec.rb +++ b/spec/requests/library_staff_spec.rb @@ -12,7 +12,7 @@ title: 'Trout, Nimbus', id: 00_0000_002, type: 'Library Staff', - url: 'https://library.princeton.edu/staff/nimbuskt', + url: 'https://library.psb-prod.princeton.edu/people/nimbus-kilgore-trout', other_fields: { building: 'Firestone Library', department: 'Office of the Deputy Dean of Libraries',