From 4c3b7287573298deaa523080fc1877393dc5c58a Mon Sep 17 00:00:00 2001 From: Rodrigo Virgilio Date: Sat, 8 Aug 2026 13:41:08 +0100 Subject: [PATCH 1/2] Fix flaky system tests for account request and partner group editing --- spec/system/account_request_system_spec.rb | 10 ++++++---- spec/system/partner_system_spec.rb | 7 ++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/spec/system/account_request_system_spec.rb b/spec/system/account_request_system_spec.rb index d34dd86673..4350df53bf 100644 --- a/spec/system/account_request_system_spec.rb +++ b/spec/system/account_request_system_spec.rb @@ -35,12 +35,14 @@ expect(AccountRequest.count).to eq(0) - expect { click_button 'Submit' }.to change(AccountRequest, :count).by(1) + click_button 'Submit' - created_account_request = AccountRequest.last - - # Request Received + # Wait for the redirect before asserting on the count, otherwise the + # async form submission may not have been processed yet. expect(page).to have_content('Request Received!') + expect(AccountRequest.count).to eq(1) + + created_account_request = AccountRequest.last expect(page).to have_content("We've sent you a email with instructions on next steps at #{created_account_request.email}!") # Access link within email they would have received diff --git a/spec/system/partner_system_spec.rb b/spec/system/partner_system_spec.rb index 2e525e4136..d4c9d1d9fe 100644 --- a/spec/system/partner_system_spec.rb +++ b/spec/system/partner_system_spec.rb @@ -766,9 +766,10 @@ def post_refresh visit partners_path click_on 'Groups' - assert page.has_content? existing_partner_group.name, wait: page_content_wait - - click_on 'Edit' + within '#nav-partner-groups', wait: page_content_wait do + assert page.has_content? existing_partner_group.name + click_on 'Edit' + end post_refresh end From a8f612e186aa27254534c2e0914bced1fe149d00 Mon Sep 17 00:00:00 2001 From: Rodrigo Virgilio Date: Sat, 8 Aug 2026 15:35:08 +0100 Subject: [PATCH 2/2] Upgrade Rails to 8.1.3.1 to address Brakeman EOL warning --- Gemfile | 2 +- Gemfile.lock | 115 ++++++++++--------- spec/requests/distributions_requests_spec.rb | 2 +- spec/requests/requests_requests_spec.rb | 2 +- spec/services/calendar_service_spec.rb | 2 +- 5 files changed, 63 insertions(+), 60 deletions(-) diff --git a/Gemfile b/Gemfile index 52f4200cf0..7a48096758 100644 --- a/Gemfile +++ b/Gemfile @@ -14,7 +14,7 @@ gem "pg", "~> 1.6.3" # Web server. gem "puma" # Rails web framework. -gem "rails", "~> 8.0.2" +gem "rails", "~> 8.1.0" ###### MODELS / DATABASE ####### diff --git a/Gemfile.lock b/Gemfile.lock index efaaca3764..9f574469f4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,29 +2,31 @@ GEM remote: https://rubygems.org/ specs: Ascii85 (2.0.1) - actioncable (8.0.2.1) - actionpack (= 8.0.2.1) - activesupport (= 8.0.2.1) + action_text-trix (2.1.19) + railties + actioncable (8.1.3.1) + actionpack (= 8.1.3.1) + activesupport (= 8.1.3.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (8.0.2.1) - actionpack (= 8.0.2.1) - activejob (= 8.0.2.1) - activerecord (= 8.0.2.1) - activestorage (= 8.0.2.1) - activesupport (= 8.0.2.1) + actionmailbox (8.1.3.1) + actionpack (= 8.1.3.1) + activejob (= 8.1.3.1) + activerecord (= 8.1.3.1) + activestorage (= 8.1.3.1) + activesupport (= 8.1.3.1) mail (>= 2.8.0) - actionmailer (8.0.2.1) - actionpack (= 8.0.2.1) - actionview (= 8.0.2.1) - activejob (= 8.0.2.1) - activesupport (= 8.0.2.1) + actionmailer (8.1.3.1) + actionpack (= 8.1.3.1) + actionview (= 8.1.3.1) + activejob (= 8.1.3.1) + activesupport (= 8.1.3.1) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (8.0.2.1) - actionview (= 8.0.2.1) - activesupport (= 8.0.2.1) + actionpack (8.1.3.1) + actionview (= 8.1.3.1) + activesupport (= 8.1.3.1) nokogiri (>= 1.8.5) rack (>= 2.2.4) rack-session (>= 1.0.1) @@ -32,42 +34,43 @@ GEM rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actiontext (8.0.2.1) - actionpack (= 8.0.2.1) - activerecord (= 8.0.2.1) - activestorage (= 8.0.2.1) - activesupport (= 8.0.2.1) + actiontext (8.1.3.1) + action_text-trix (~> 2.1.15) + actionpack (= 8.1.3.1) + activerecord (= 8.1.3.1) + activestorage (= 8.1.3.1) + activesupport (= 8.1.3.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (8.0.2.1) - activesupport (= 8.0.2.1) + actionview (8.1.3.1) + activesupport (= 8.1.3.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (8.0.2.1) - activesupport (= 8.0.2.1) + activejob (8.1.3.1) + activesupport (= 8.1.3.1) globalid (>= 0.3.6) - activemodel (8.0.2.1) - activesupport (= 8.0.2.1) - activerecord (8.0.2.1) - activemodel (= 8.0.2.1) - activesupport (= 8.0.2.1) + activemodel (8.1.3.1) + activesupport (= 8.1.3.1) + activerecord (8.1.3.1) + activemodel (= 8.1.3.1) + activesupport (= 8.1.3.1) timeout (>= 0.4.0) - activestorage (8.0.2.1) - actionpack (= 8.0.2.1) - activejob (= 8.0.2.1) - activerecord (= 8.0.2.1) - activesupport (= 8.0.2.1) + activestorage (8.1.3.1) + actionpack (= 8.1.3.1) + activejob (= 8.1.3.1) + activerecord (= 8.1.3.1) + activesupport (= 8.1.3.1) marcel (~> 1.0) - activesupport (8.0.2.1) + activesupport (8.1.3.1) base64 - benchmark (>= 0.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + json logger (>= 1.4.2) minitest (>= 5.1) securerandom (>= 0.3) @@ -112,7 +115,6 @@ GEM nokogiri (~> 1, >= 1.10.8) base64 (0.3.0) bcrypt (3.1.22) - benchmark (0.5.0) better_errors (2.10.1) erubi (>= 1.0.0) rack (>= 0.9.0) @@ -547,20 +549,20 @@ GEM rack (>= 1.3) rackup (2.3.1) rack (>= 3) - rails (8.0.2.1) - actioncable (= 8.0.2.1) - actionmailbox (= 8.0.2.1) - actionmailer (= 8.0.2.1) - actionpack (= 8.0.2.1) - actiontext (= 8.0.2.1) - actionview (= 8.0.2.1) - activejob (= 8.0.2.1) - activemodel (= 8.0.2.1) - activerecord (= 8.0.2.1) - activestorage (= 8.0.2.1) - activesupport (= 8.0.2.1) + rails (8.1.3.1) + actioncable (= 8.1.3.1) + actionmailbox (= 8.1.3.1) + actionmailer (= 8.1.3.1) + actionpack (= 8.1.3.1) + actiontext (= 8.1.3.1) + actionview (= 8.1.3.1) + activejob (= 8.1.3.1) + activemodel (= 8.1.3.1) + activerecord (= 8.1.3.1) + activestorage (= 8.1.3.1) + activesupport (= 8.1.3.1) bundler (>= 1.15.0) - railties (= 8.0.2.1) + railties (= 8.1.3.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -577,13 +579,14 @@ GEM rails-html-sanitizer (1.7.0) loofah (~> 2.25) 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 (8.0.2.1) - actionpack (= 8.0.2.1) - activesupport (= 8.0.2.1) + railties (8.1.3.1) + actionpack (= 8.1.3.1) + activesupport (= 8.1.3.1) irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.4.2) @@ -838,7 +841,7 @@ DEPENDENCIES pry-remote puma rack-mini-profiler - rails (~> 8.0.2) + rails (~> 8.1.0) rails-controller-testing rails-erd recaptcha diff --git a/spec/requests/distributions_requests_spec.rb b/spec/requests/distributions_requests_spec.rb index 39c58c4b1f..c429032754 100644 --- a/spec/requests/distributions_requests_spec.rb +++ b/spec/requests/distributions_requests_spec.rb @@ -665,7 +665,7 @@ storage_location_id: location.id, 'issued_at(1i)' => issued_at.to_date.year, 'issued_at(2i)' => issued_at.to_date.month, - 'issued_at(3i)' => nil # day part of date missing + 'issued_at(3i)' => '' # day part of date missing }} end diff --git a/spec/requests/requests_requests_spec.rb b/spec/requests/requests_requests_spec.rb index af085e1e91..471b61f04a 100644 --- a/spec/requests/requests_requests_spec.rb +++ b/spec/requests/requests_requests_spec.rb @@ -196,7 +196,7 @@ get requests_path(fulfilled_request) page = Nokogiri::HTML(response.body) - cancel_button = page.at_css('button') { |el| el.text.strip == 'Cancel' } + cancel_button = page.at_css('button[data-disable-with="Please wait..."], input[value="Cancel"]') expect(cancel_button).not_to be_present end diff --git a/spec/services/calendar_service_spec.rb b/spec/services/calendar_service_spec.rb index 6dd7f598b7..7dbbb11958 100644 --- a/spec/services/calendar_service_spec.rb +++ b/spec/services/calendar_service_spec.rb @@ -92,7 +92,7 @@ ["Newfoundland -03:30", "America/St_Johns"]] result = described_class.time_zones - expect(result.size).to eq(151) + expect(result.size).to eq(152) expect(result[0..11]).to eq(expected) end end