Skip to content

Commit

Permalink
Merge pull request #4669 from pulibrary/rails-7-2
Browse files Browse the repository at this point in the history
Rails 7.2
  • Loading branch information
sandbergja authored Dec 30, 2024
2 parents f3ebe8d + b528c41 commit f4cfae3
Show file tree
Hide file tree
Showing 20 changed files with 111 additions and 120 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source 'https://rubygems.org'

gem 'rails', '~> 7.1.0'
gem 'rails', '~> 7.2.2'

gem 'alma'
gem 'babel-transpiler'
Expand Down
137 changes: 66 additions & 71 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,88 +8,82 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (7.1.5.1)
actionpack (= 7.1.5.1)
activesupport (= 7.1.5.1)
actioncable (7.2.2.1)
actionpack (= 7.2.2.1)
activesupport (= 7.2.2.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.5.1)
actionpack (= 7.1.5.1)
activejob (= 7.1.5.1)
activerecord (= 7.1.5.1)
activestorage (= 7.1.5.1)
activesupport (= 7.1.5.1)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.5.1)
actionpack (= 7.1.5.1)
actionview (= 7.1.5.1)
activejob (= 7.1.5.1)
activesupport (= 7.1.5.1)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
actionmailbox (7.2.2.1)
actionpack (= 7.2.2.1)
activejob (= 7.2.2.1)
activerecord (= 7.2.2.1)
activestorage (= 7.2.2.1)
activesupport (= 7.2.2.1)
mail (>= 2.8.0)
actionmailer (7.2.2.1)
actionpack (= 7.2.2.1)
actionview (= 7.2.2.1)
activejob (= 7.2.2.1)
activesupport (= 7.2.2.1)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.1.5.1)
actionview (= 7.1.5.1)
activesupport (= 7.1.5.1)
actionpack (7.2.2.1)
actionview (= 7.2.2.1)
activesupport (= 7.2.2.1)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack (>= 2.2.4, < 3.2)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.5.1)
actionpack (= 7.1.5.1)
activerecord (= 7.1.5.1)
activestorage (= 7.1.5.1)
activesupport (= 7.1.5.1)
useragent (~> 0.16)
actiontext (7.2.2.1)
actionpack (= 7.2.2.1)
activerecord (= 7.2.2.1)
activestorage (= 7.2.2.1)
activesupport (= 7.2.2.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.5.1)
activesupport (= 7.1.5.1)
actionview (7.2.2.1)
activesupport (= 7.2.2.1)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.5.1)
activesupport (= 7.1.5.1)
activejob (7.2.2.1)
activesupport (= 7.2.2.1)
globalid (>= 0.3.6)
activemodel (7.1.5.1)
activesupport (= 7.1.5.1)
activerecord (7.1.5.1)
activemodel (= 7.1.5.1)
activesupport (= 7.1.5.1)
activemodel (7.2.2.1)
activesupport (= 7.2.2.1)
activerecord (7.2.2.1)
activemodel (= 7.2.2.1)
activesupport (= 7.2.2.1)
timeout (>= 0.4.0)
activestorage (7.1.5.1)
actionpack (= 7.1.5.1)
activejob (= 7.1.5.1)
activerecord (= 7.1.5.1)
activesupport (= 7.1.5.1)
activestorage (7.2.2.1)
actionpack (= 7.2.2.1)
activejob (= 7.2.2.1)
activerecord (= 7.2.2.1)
activesupport (= 7.2.2.1)
marcel (~> 1.0)
activesupport (7.1.5.1)
activesupport (7.2.2.1)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
securerandom (>= 0.3)
tzinfo (~> 2.0)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
airbrussh (1.5.3)
sshkit (>= 1.6.1, != 1.7.0)
alma (0.6.1)
alma (0.6.2)
activesupport
httparty
xml-simple
Expand Down Expand Up @@ -211,7 +205,7 @@ GEM
csl-styles (2.0.1)
csl (~> 2.0)
csv (3.3.0)
datadog (2.7.0)
datadog (2.7.1)
datadog-ruby_core_source (~> 3.3)
libdatadog (~> 14.1.0.1.0)
libddwaf (~> 1.15.0.0.0)
Expand Down Expand Up @@ -305,7 +299,7 @@ GEM
terminal-table (>= 1.8)
friendly_id (5.4.2)
activerecord (>= 4.0.0)
global (2.1.0)
global (3.0.0)
activesupport (>= 2.0)
globalid (1.2.1)
activesupport (>= 6.1)
Expand Down Expand Up @@ -489,20 +483,20 @@ GEM
rack (>= 1.3)
rackup (2.2.1)
rack (>= 3)
rails (7.1.5.1)
actioncable (= 7.1.5.1)
actionmailbox (= 7.1.5.1)
actionmailer (= 7.1.5.1)
actionpack (= 7.1.5.1)
actiontext (= 7.1.5.1)
actionview (= 7.1.5.1)
activejob (= 7.1.5.1)
activemodel (= 7.1.5.1)
activerecord (= 7.1.5.1)
activestorage (= 7.1.5.1)
activesupport (= 7.1.5.1)
rails (7.2.2.1)
actioncable (= 7.2.2.1)
actionmailbox (= 7.2.2.1)
actionmailer (= 7.2.2.1)
actionpack (= 7.2.2.1)
actiontext (= 7.2.2.1)
actionview (= 7.2.2.1)
activejob (= 7.2.2.1)
activemodel (= 7.2.2.1)
activerecord (= 7.2.2.1)
activestorage (= 7.2.2.1)
activesupport (= 7.2.2.1)
bundler (>= 1.15.0)
railties (= 7.1.5.1)
railties (= 7.2.2.1)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -514,10 +508,10 @@ GEM
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
railties (7.1.5.1)
actionpack (= 7.1.5.1)
activesupport (= 7.1.5.1)
irb
railties (7.2.2.1)
actionpack (= 7.2.2.1)
activesupport (= 7.2.2.1)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
Expand Down Expand Up @@ -585,7 +579,7 @@ GEM
rubocop-performance (1.23.0)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.27.0)
rubocop-rails (2.28.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.52.0, < 2.0)
Expand Down Expand Up @@ -704,6 +698,7 @@ GEM
unf (0.2.0)
unicode-display_width (2.6.0)
uri (1.0.2)
useragent (0.16.11)
vcr (6.3.1)
base64
view_component (2.83.0)
Expand Down Expand Up @@ -811,7 +806,7 @@ DEPENDENCIES
puma (~> 6.4)
rack-attack
rack-mini-profiler
rails (~> 7.1.0)
rails (~> 7.2.2)
rails-controller-testing
rake
redis
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Status](https://coveralls.io/repos/github/pulibrary/orangelight/badge.svg?branch
Versions:

* Ruby: 3.3.6
* Rails: 7.1
* Rails: 7.2
* Blacklight: 8.7

## Development pre-requisites
Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.1].define(version: 2024_07_25_171021) do
ActiveRecord::Schema[7.2].define(version: 2024_07_25_171021) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
enable_extension "unaccent"
Expand Down
6 changes: 3 additions & 3 deletions spec/controllers/requests/form_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require "mail"

describe Requests::FormController, type: :controller, vcr: { cassette_name: 'form_controller', record: :none }, requests: true do
let(:valid_patron_response) { fixture('/bibdata_patron_response.json') }
let(:valid_barcode_patron_response) { fixture('/bibdata_patron_response_barcode.json') }
let(:invalid_patron_response) { fixture('/bibdata_not_found_patron_response.json') }
let(:valid_patron_response) { file_fixture('../bibdata_patron_response.json') }
let(:valid_barcode_patron_response) { file_fixture('../bibdata_patron_response_barcode.json') }
let(:invalid_patron_response) { file_fixture('../bibdata_not_found_patron_response.json') }
let(:user) { FactoryBot.create(:user) }

describe 'POST #generate' do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/email_authentication_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
describe 'email form' do
let(:bibid) { '9979948663506421' }
let(:user) { FactoryBot.create(:valid_princeton_patron) }
let(:valid_patron_response) { fixture('/bibdata_patron_response.json') }
let(:valid_patron_response) { file_fixture('../bibdata_patron_response.json') }

before do
current_illiad_user_uri = "#{Requests.config[:illiad_api_base]}/ILLiadWebPlatform/Users/jstudent"
Expand Down
24 changes: 12 additions & 12 deletions spec/features/requests/form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
let(:transaction_url) { "https://lib-illiad.princeton.edu/ILLiadWebPlatform/transaction" }
let(:transaction_note_url) { "https://lib-illiad.princeton.edu/ILLiadWebPlatform/transaction/1093806/notes" }

let(:valid_patron_response) { fixture('/bibdata_patron_response.json') }
let(:valid_patron_no_barcode_response) { fixture('/bibdata_patron_no_barcode_response.json') }
let(:valid_barcode_patron_response) { fixture('/bibdata_patron_response_barcode.json') }
let(:valid_patron_no_campus_response) { fixture('/bibdata_patron_response_no_campus.json') }
let(:valid_graduate_student_no_campus_response) { fixture('/bibdata_patron_response_graduate_no_campus.json') }
let(:invalid_patron_response) { fixture('/bibdata_not_found_patron_response.json') }
let(:valid_patron_response_no_ldap) { fixture('/bibdata_patron_response_no_ldap.json') }
let(:valid_patron_response) { file_fixture('../bibdata_patron_response.json') }
let(:valid_patron_no_barcode_response) { file_fixture('../bibdata_patron_no_barcode_response.json') }
let(:valid_barcode_patron_response) { file_fixture('../bibdata_patron_response_barcode.json') }
let(:valid_patron_no_campus_response) { file_fixture('../bibdata_patron_response_no_campus.json') }
let(:valid_graduate_student_no_campus_response) { file_fixture('../bibdata_patron_response_graduate_no_campus.json') }
let(:invalid_patron_response) { file_fixture('../bibdata_not_found_patron_response.json') }
let(:valid_patron_response_no_ldap) { file_fixture('../bibdata_patron_response_no_ldap.json') }

let(:responses) do
{
Expand Down Expand Up @@ -106,7 +106,7 @@
end

describe 'When visiting an Alma ID as a CAS User' do
let(:good_response) { fixture('/scsb_request_item_response.json') }
let(:good_response) { file_fixture('../scsb_request_item_response.json') }
it 'Shows a ReCAP PUL item that is at "preservation and conservation" as a partner request' do
stub_illiad_patron
stub_request(:post, transaction_url)
Expand Down Expand Up @@ -149,7 +149,7 @@
.to_return(status: 200, body: "<document count='1' sent='true'></document>", headers: {})
stub_request(:post, "#{Alma.configuration.region}/almaws/v1/bibs/9994933183506421/holdings/22558528920006421/items/23558528910006421/requests?user_id=960594184")
.with(body: hash_including(request_type: "HOLD", pickup_location_type: "LIBRARY", pickup_location_library: "firestone"))
.to_return(status: 200, body: fixture("alma_hold_response.json"), headers: { 'content-type': 'application/json' })
.to_return(status: 200, body: file_fixture("../alma_hold_response.json"), headers: { 'content-type': 'application/json' })
visit "/requests/#{mms_id}"
expect(page).to have_content 'Electronic Delivery'
# some weird issue with this and capybara examining the page source shows it is there.
Expand Down Expand Up @@ -526,7 +526,7 @@
.to_return(status: 200, body: good_response, headers: {})
stub_request(:post, "#{Alma.configuration.region}/almaws/v1/bibs/99115783193506421/holdings/22534122440006421/items/23534122430006421/requests?user_id=960594184")
.with(body: hash_including(request_type: "HOLD", pickup_location_type: "LIBRARY", pickup_location_library: "firestone"))
.to_return(status: 200, body: fixture("alma_hold_response.json"), headers: { 'content-type': 'application/json' })
.to_return(status: 200, body: file_fixture("../alma_hold_response.json"), headers: { 'content-type': 'application/json' })
visit '/requests/99115783193506421?mfhd=22534122440006421'
expect(page).not_to have_content 'Item is not requestable.'
expect(page).not_to have_content 'Electronic Delivery'
Expand Down Expand Up @@ -1124,7 +1124,7 @@
expect(page).not_to have_content 'Only items available for digitization can be requested when you do not have a barcode registered with the Library. Library staff will work to try to get you access to a digital copy of the desired material.'
end

let(:good_response) { fixture('/scsb_request_item_response.json') }
let(:good_response) { file_fixture('../scsb_request_item_response.json') }
it 'disallows access to request a physical ReCAP item' do
stub_scsb_availability(bib_id: "9999443553506421", institution_id: "PUL", barcode: '32101098722844')
visit '/requests/9999443553506421?mfhd=22743365320006421'
Expand Down Expand Up @@ -1247,7 +1247,7 @@
end

context 'An Alma user that does not have a Net ID' do
let(:alma_login_response) { fixture('/alma_login_response.json') }
let(:alma_login_response) { file_fixture('../alma_login_response.json') }
let(:user) { FactoryBot.create(:valid_alma_patron) }
before do
stub_request(:get, "#{Alma.configuration.region}/almaws/v1/users/#{user.uid}?expand=fees,requests,loans")
Expand Down
2 changes: 1 addition & 1 deletion spec/features/requests/marquand_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
stub_request(:post, "#{Requests.config[:scsb_base]}/requestItem/requestItem")
.to_return(status: 200, body: good_response, headers: {})
end
let(:good_response) { fixture('/scsb_request_item_response.json') }
let(:good_response) { file_fixture('../scsb_request_item_response.json') }
before do
scsb_post_stub
stub_scsb_availability(bib_id:, institution_id: "PUL", barcode: item_barcode)
Expand Down
2 changes: 1 addition & 1 deletion spec/mailers/requests/request_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# rubocop:disable RSpec/MultipleExpectations
# rubocop:disable Metrics/BlockLength
describe Requests::RequestMailer, type: :mailer, vcr: { cassette_name: 'mailer', record: :none }, requests: true do
let(:valid_patron_response) { fixture('/bibdata_patron_response.json') }
let(:valid_patron_response) { file_fixture('../bibdata_patron_response.json') }

let(:user_info) do
stub_request(:get, "#{Requests.config[:bibdata_base]}/patron/foo?ldap=true").to_return(status: 200, body: valid_patron_response, headers: {})
Expand Down
2 changes: 1 addition & 1 deletion spec/models/concerns/requests/scsb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
let(:patron) do
Requests::Patron.new(user:, patron_hash: valid_patron)
end
let(:scsb_no_format) { fixture('/SCSB-7935196.json') }
let(:scsb_no_format) { file_fixture('../SCSB-7935196.json') }
let(:location_code) { 'scsbnypl' }
let(:params) do
{
Expand Down
2 changes: 1 addition & 1 deletion spec/models/requests/alma_patron_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
RSpec.describe Requests::AlmaPatron, requests: true, patrons: true do
context 'with a call to Alma' do
let(:uid) { 'BC123456789' }
let(:patron_with_multiple_barcodes) { fixture('/BC123456789.json') }
let(:patron_with_multiple_barcodes) { file_fixture('../BC123456789.json') }
let(:alma_stub) do
stub_request(:get, "https://api-na.hosted.exlibrisgroup.com/almaws/v1/users/#{uid}?expand=fees,requests,loans")
.to_return(status: 200, body: patron_with_multiple_barcodes, headers: { "Content-Type" => "application/json" })
Expand Down
2 changes: 1 addition & 1 deletion spec/models/requests/form_no_vcr_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
stub_request(:get, "https://catalog.princeton.edu/catalog/#{document_id}/raw")
.to_return(status: 200, body: catalog_raw_fixture)
stub_request(:get, "#{Requests.config[:bibdata_base]}/locations/holding_locations/eastasian$cjk.json")
.to_return(status: 200, body: fixture('/bibdata/eastasian_cjk_holding_locations.json'))
.to_return(status: 200, body: file_fixture('../bibdata/eastasian_cjk_holding_locations.json'))
stub_request(:get, "#{Requests.config[:bibdata_base]}/bibliographic/#{params[:system_id]}/holdings/#{params[:mfhd]}/availability.json").to_timeout
stub_delivery_locations
end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/requests/full_patron_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

context 'with a patron' do
let(:patron) { described_class.new(user:) }
let(:valid_patron_response) { fixture('/bibdata_patron_response.json') }
let(:valid_patron_response) { file_fixture('../bibdata_patron_response.json') }
let(:bibdata_mock) do
stub_request(:get, "#{Requests.config[:bibdata_base]}/patron/abc123?ldap=true")
.to_return(status: 200, body: valid_patron_response, headers: {})
Expand Down
Loading

0 comments on commit f4cfae3

Please sign in to comment.