From 7bfffb075ddcd69289d064a884ebaa2a323e1403 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Mar 2025 11:08:11 +0000 Subject: [PATCH 1/3] Bump rubocop-govuk from 5.0.8 to 5.0.9 Bumps [rubocop-govuk](https://github.com/alphagov/rubocop-govuk) from 5.0.8 to 5.0.9. - [Changelog](https://github.com/alphagov/rubocop-govuk/blob/main/CHANGELOG.md) - [Commits](https://github.com/alphagov/rubocop-govuk/compare/v5.0.8...v5.0.9) --- updated-dependencies: - dependency-name: rubocop-govuk dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a97bc3dc4..922c70800 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -275,6 +275,7 @@ GEM rest-client (~> 2.0) language_server-protocol (3.17.0.4) link_header (0.0.8) + lint_roller (1.1.0) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) @@ -702,36 +703,40 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.2) - rubocop (1.70.0) + rubocop (1.73.2) json (~> 2.3) - language_server-protocol (>= 3.17.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.36.2, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.37.0) + rubocop-ast (1.38.1) parser (>= 3.3.1.0) rubocop-capybara (2.21.0) rubocop (~> 1.41) - rubocop-govuk (5.0.8) - rubocop (= 1.70.0) - rubocop-ast (= 1.37.0) + rubocop-govuk (5.0.9) + rubocop (= 1.73.2) + rubocop-ast (= 1.38.1) rubocop-capybara (= 2.21.0) - rubocop-rails (= 2.28.0) - rubocop-rake (= 0.6.0) - rubocop-rspec (= 3.3.0) - rubocop-rails (2.28.0) + rubocop-rails (= 2.30.3) + rubocop-rake (= 0.7.1) + rubocop-rspec (= 3.5.0) + rubocop-rails (2.30.3) activesupport (>= 4.2.0) + lint_roller (~> 1.1) rack (>= 1.1) - rubocop (>= 1.52.0, < 2.0) - rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rake (0.6.0) - rubocop (~> 1.0) - rubocop-rspec (3.3.0) - rubocop (~> 1.61) + rubocop (>= 1.72.1, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) + rubocop-rake (0.7.1) + lint_roller (~> 1.1) + rubocop (>= 1.72.1) + rubocop-rspec (3.5.0) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) rubyzip (2.4.1) From dde315398464f6120bfa5811b11b7930ebe72458 Mon Sep 17 00:00:00 2001 From: Bruce Bolt Date: Mon, 10 Mar 2025 09:28:26 +0000 Subject: [PATCH 2/3] Autocorrect rubocop failures --- test/integration/api_users_test.rb | 6 +++--- test/service_consumers/pact_helper.rb | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/test/integration/api_users_test.rb b/test/integration/api_users_test.rb index 89893edbe..cc55b9fb3 100644 --- a/test/integration/api_users_test.rb +++ b/test/integration/api_users_test.rb @@ -59,9 +59,9 @@ class ManageApiUsersTest < ActionDispatch::IntegrationTest assert page.has_selector?("div[role='alert'] input[value='#{token}']") # shows truncated token - assert page.has_selector?("code", text: (token[0..7]).to_s) - assert_not page.has_selector?("code", text: (token[9..-9]).to_s) - assert page.has_selector?("code", text: (token[-8..]).to_s) + assert page.has_selector?("code", text: token[0..7].to_s) + assert_not page.has_selector?("code", text: token[9..-9].to_s) + assert page.has_selector?("code", text: token[-8..].to_s) click_link @api_user.name click_link "Manage permissions" diff --git a/test/service_consumers/pact_helper.rb b/test/service_consumers/pact_helper.rb index 8b00fd804..ae5486a21 100644 --- a/test/service_consumers/pact_helper.rb +++ b/test/service_consumers/pact_helper.rb @@ -20,9 +20,7 @@ def self.generate(_opts = {}) config.include FactoryBot::Syntax::Methods end -def url_encode(str) - ERB::Util.url_encode(str) -end +delegate :url_encode, to: :'ERB::Util' def stub_access_token_creation! # This stubs Doorkeeper so can ensure the token we generate is predictable, so we can run From 88cb15a800256b6ec1acd92160a1a097b2f2dd1b Mon Sep 17 00:00:00 2001 From: Bruce Bolt Date: Mon, 10 Mar 2025 14:07:38 +0000 Subject: [PATCH 3/3] Remove delegation to `ERB::Util` It is unclear why we are delegating this method to `ERB::Util` instead of simply including the module. --- test/service_consumers/pact_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/service_consumers/pact_helper.rb b/test/service_consumers/pact_helper.rb index ae5486a21..42352018a 100644 --- a/test/service_consumers/pact_helper.rb +++ b/test/service_consumers/pact_helper.rb @@ -20,8 +20,6 @@ def self.generate(_opts = {}) config.include FactoryBot::Syntax::Methods end -delegate :url_encode, to: :'ERB::Util' - def stub_access_token_creation! # This stubs Doorkeeper so can ensure the token we generate is predictable, so we can run # the Pact tests with a dummy bearer token @@ -31,6 +29,8 @@ def stub_access_token_creation! end Pact.service_provider "Signon API" do + include ERB::Util + honours_pact_with "GDS API Adapters" do if ENV["PACT_URI"] pact_uri(ENV["PACT_URI"])