From 08a654f1674d8e6cb0254c03a53176217cebafdf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 12:33:11 +0000 Subject: [PATCH] Bump rails from 7.0.8 to 7.1.3 Bumps [rails](https://github.com/rails/rails) from 7.0.8 to 7.1.3. - [Release notes](https://github.com/rails/rails/releases) - [Commits](https://github.com/rails/rails/compare/v7.0.8...v7.1.3) --- updated-dependencies: - dependency-name: rails dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 164 +++++++++++------- bin/setup | 2 +- config/application.rb | 2 +- config/boot.rb | 2 +- config/environments/development.rb | 4 +- config/environments/production.rb | 8 +- config/environments/test.rb | 13 +- test/integration/how_government_works_test.rb | 14 +- .../service_manual_topic_presenter_test.rb | 2 +- test/test_helper.rb | 2 +- 11 files changed, 126 insertions(+), 89 deletions(-) diff --git a/Gemfile b/Gemfile index 7b30cd47c..2dc0c1f6c 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" ruby "~> 3.2.0" -gem "rails", "7.0.8" +gem "rails", "7.1.3" gem "bootsnap", require: false gem "dalli" diff --git a/Gemfile.lock b/Gemfile.lock index 6f29e4baf..ed9afa9e5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,75 +1,85 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.0.8) - actionpack (= 7.0.8) - activesupport (= 7.0.8) + actioncable (7.1.3) + actionpack (= 7.1.3) + activesupport (= 7.1.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.8) - actionpack (= 7.0.8) - activejob (= 7.0.8) - activerecord (= 7.0.8) - activestorage (= 7.0.8) - activesupport (= 7.0.8) + zeitwerk (~> 2.6) + actionmailbox (7.1.3) + actionpack (= 7.1.3) + activejob (= 7.1.3) + activerecord (= 7.1.3) + activestorage (= 7.1.3) + activesupport (= 7.1.3) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.8) - actionpack (= 7.0.8) - actionview (= 7.0.8) - activejob (= 7.0.8) - activesupport (= 7.0.8) + actionmailer (7.1.3) + actionpack (= 7.1.3) + actionview (= 7.1.3) + activejob (= 7.1.3) + activesupport (= 7.1.3) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.8) - actionview (= 7.0.8) - activesupport (= 7.0.8) - rack (~> 2.0, >= 2.2.4) + rails-dom-testing (~> 2.2) + actionpack (7.1.3) + actionview (= 7.1.3) + activesupport (= 7.1.3) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.8) - actionpack (= 7.0.8) - activerecord (= 7.0.8) - activestorage (= 7.0.8) - activesupport (= 7.0.8) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.3) + actionpack (= 7.1.3) + activerecord (= 7.1.3) + activestorage (= 7.1.3) + activesupport (= 7.1.3) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.8) - activesupport (= 7.0.8) + actionview (7.1.3) + activesupport (= 7.1.3) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.8) - activesupport (= 7.0.8) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.3) + activesupport (= 7.1.3) globalid (>= 0.3.6) - activemodel (7.0.8) - activesupport (= 7.0.8) - activerecord (7.0.8) - activemodel (= 7.0.8) - activesupport (= 7.0.8) - activestorage (7.0.8) - actionpack (= 7.0.8) - activejob (= 7.0.8) - activerecord (= 7.0.8) - activesupport (= 7.0.8) + activemodel (7.1.3) + activesupport (= 7.1.3) + activerecord (7.1.3) + activemodel (= 7.1.3) + activesupport (= 7.1.3) + timeout (>= 0.4.0) + activestorage (7.1.3) + actionpack (= 7.1.3) + activejob (= 7.1.3) + activerecord (= 7.1.3) + activesupport (= 7.1.3) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.8) + activesupport (7.1.3) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) ansi (1.5.0) ast (2.4.2) + base64 (0.2.0) better_errors (2.10.1) erubi (>= 1.0.0) rack (>= 0.9.0) @@ -81,6 +91,7 @@ GEM erubi (~> 1.4) parser (>= 2.4) smart_properties + bigdecimal (3.1.5) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) bootsnap (1.17.1) @@ -101,6 +112,7 @@ GEM climate_control (1.2.0) coderay (1.1.3) concurrent-ruby (1.2.3) + connection_pool (2.4.1) crack (0.4.5) rexml crass (1.0.6) @@ -110,6 +122,8 @@ GEM debug_inspector (1.1.0) docile (1.4.0) domain_name (0.6.20240107) + drb (2.2.0) + ruby2_keywords erubi (1.12.0) execjs (2.8.1) faker (3.2.2) @@ -188,6 +202,10 @@ GEM rails-i18n rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) + io-console (0.7.1) + irb (1.11.1) + rdoc + reline (>= 0.4.2) json (2.6.3) json-schema (4.1.1) addressable (>= 2.8) @@ -223,6 +241,7 @@ GEM mocha (2.1.0) ruby2_keywords (>= 0.0.5) msgpack (1.7.2) + mutex_m (0.2.0) net-imap (0.4.9.1) date net-protocol @@ -445,29 +464,36 @@ GEM pry-byebug (3.10.1) byebug (~> 11.0) pry (>= 0.13, < 0.15) + psych (5.1.2) + stringio public_suffix (5.0.4) puma (6.4.2) nio4r (~> 2.0) racc (1.7.3) - rack (2.2.8) + rack (3.0.8) rack-proxy (0.7.7) rack + rack-session (2.0.0) + rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.8) - actioncable (= 7.0.8) - actionmailbox (= 7.0.8) - actionmailer (= 7.0.8) - actionpack (= 7.0.8) - actiontext (= 7.0.8) - actionview (= 7.0.8) - activejob (= 7.0.8) - activemodel (= 7.0.8) - activerecord (= 7.0.8) - activestorage (= 7.0.8) - activesupport (= 7.0.8) + rackup (2.1.0) + rack (>= 3) + webrick (~> 1.8) + rails (7.1.3) + actioncable (= 7.1.3) + actionmailbox (= 7.1.3) + actionmailer (= 7.1.3) + actionpack (= 7.1.3) + actiontext (= 7.1.3) + actionview (= 7.1.3) + activejob (= 7.1.3) + activemodel (= 7.1.3) + activerecord (= 7.1.3) + activestorage (= 7.1.3) + activesupport (= 7.1.3) bundler (>= 1.15.0) - railties (= 7.0.8) + railties (= 7.1.3) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -487,16 +513,21 @@ GEM csv (~> 3.2) i18n-tasks rails-i18n - railties (7.0.8) - actionpack (= 7.0.8) - activesupport (= 7.0.8) - method_source + railties (7.1.3) + actionpack (= 7.1.3) + activesupport (= 7.1.3) + irb + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.1.0) + rdoc (6.6.2) + psych (>= 4.0.0) regexp_parser (2.8.3) + reline (0.4.2) + io-console (~> 0.5) request_store (1.5.1) rack (>= 1.4) rest-client (2.1.0) @@ -588,6 +619,7 @@ GEM activesupport (>= 5.2) sprockets (>= 3.0.0) statsd-ruby (1.5.0) + stringio (3.1.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) thor (1.3.0) @@ -637,7 +669,7 @@ DEPENDENCIES mocha plek pry-byebug - rails (= 7.0.8) + rails (= 7.1.3) rails-controller-testing rails-i18n rails_translation_manager diff --git a/bin/setup b/bin/setup index 57b65c85d..cf2acd188 100755 --- a/bin/setup +++ b/bin/setup @@ -5,7 +5,7 @@ require "fileutils" APP_ROOT = File.expand_path("..", __dir__) def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") + system(*args, exception: true) end FileUtils.chdir APP_ROOT do diff --git a/config/application.rb b/config/application.rb index 03c156ced..9f431a5d0 100644 --- a/config/application.rb +++ b/config/application.rb @@ -21,7 +21,7 @@ module GovernmentFrontend class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.0 + config.load_defaults 7.1 # Settings in config/environments/* take precedence over those specified here. # Application configuration can go into files in config/initializers diff --git a/config/boot.rb b/config/boot.rb index 997563c2a..988a5ddc4 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,4 +1,4 @@ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) require "bundler/setup" # Set up gems listed in the Gemfile. -require "bootsnap/setup" +require "bootsnap/setup" # Speed up boot time by caching expensive operations. diff --git a/config/environments/development.rb b/config/environments/development.rb index fbf8292a4..f7835a68d 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -6,7 +6,7 @@ # In the development environment your application's code is reloaded any time # it changes. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. - config.cache_classes = false + config.enable_reloading = true # Do not eager load code on boot. config.eager_load = false @@ -46,7 +46,7 @@ config.assets.quiet = true # Raises error for missing translations. - config.i18n.raise_on_missing_translations = true + # config.i18n.raise_on_missing_translations = true # Annotate rendered view with file names. # config.action_view.annotate_rendered_view_with_filenames = true diff --git a/config/environments/production.rb b/config/environments/production.rb index 7796a4289..80a472023 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -4,7 +4,7 @@ # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. - config.cache_classes = true + config.enable_reloading = false # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web servers @@ -30,7 +30,7 @@ # Compress CSS using a preprocessor. # config.assets.css_compressor = :sass - # Do not fallback to assets pipeline if a precompiled asset is missed. + # Do not fall back to assets pipeline if a precompiled asset is missed. config.assets.compile = false # Rather than use a CSS compressor, use the SASS style to perform compression. @@ -44,6 +44,10 @@ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX + # Assume all access to the app is happening through a SSL-terminating reverse proxy. + # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies. + # config.assume_ssl = true + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true diff --git a/config/environments/test.rb b/config/environments/test.rb index ccb9bad78..04e791737 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -8,12 +8,13 @@ Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - # Turn false under Spring and add config.action_view.cache_template_loading = true. - config.cache_classes = true + # While tests run files are not watched, reloading is not necessary. + config.enable_reloading = false - # Eager loading loads your whole application. When running a single test locally, - # this probably isn't necessary. It's a good idea to do in a continuous integration - # system, or in some way before deploying your code. + # Eager loading loads your entire application. When running a single test locally, + # this is usually not necessary, and can slow down your test suite. However, it's + # recommended that you enable it in continuous integration systems to ensure eager + # loading is working properly before deploying your code. config.eager_load = ENV["CI"].present? # Configure public file server for tests with Cache-Control for performance. @@ -43,7 +44,7 @@ config.active_support.disallowed_deprecation_warnings = [] # Raises error for missing translations. - config.i18n.raise_on_missing_translations = true + # config.i18n.raise_on_missing_translations = true # Annotate rendered view with file names. # config.action_view.annotate_rendered_view_with_filenames = true diff --git a/test/integration/how_government_works_test.rb b/test/integration/how_government_works_test.rb index e2a655ec5..37977576a 100644 --- a/test/integration/how_government_works_test.rb +++ b/test/integration/how_government_works_test.rb @@ -16,18 +16,18 @@ class HowGovernmentWorksTest < ActionDispatch::IntegrationTest test "includes the count of ministers" do setup_and_visit_content_item("reshuffle-mode-off") - assert page.has_selector?(".gem-c-big-number", text: /#{@content_item.dig("details", "ministerial_role_counts", "prime_minister")}.+Prime Minister/m) - assert page.has_selector?(".gem-c-big-number", text: /#{@content_item.dig("details", "ministerial_role_counts", "cabinet_ministers")}.+Cabinet ministers/m) - assert page.has_selector?(".gem-c-big-number", text: /#{@content_item.dig("details", "ministerial_role_counts", "other_ministers")}.+Other ministers/m) - assert page.has_selector?(".gem-c-big-number", text: /#{@content_item.dig("details", "ministerial_role_counts", "total_ministers")}.+Total ministers/m) + assert page.has_selector?(".gem-c-big-number", text: /#{@content_item.dig('details', 'ministerial_role_counts', 'prime_minister')}.+Prime Minister/m) + assert page.has_selector?(".gem-c-big-number", text: /#{@content_item.dig('details', 'ministerial_role_counts', 'cabinet_ministers')}.+Cabinet ministers/m) + assert page.has_selector?(".gem-c-big-number", text: /#{@content_item.dig('details', 'ministerial_role_counts', 'other_ministers')}.+Other ministers/m) + assert page.has_selector?(".gem-c-big-number", text: /#{@content_item.dig('details', 'ministerial_role_counts', 'total_ministers')}.+Total ministers/m) end test "includes the count of departments" do setup_and_visit_content_item("reshuffle-mode-off") - assert page.has_selector?(".gem-c-big-number", text: /#{@content_item.dig("details", "department_counts", "ministerial_departments")}.+Ministerial departments/m) - assert page.has_selector?(".gem-c-big-number", text: /#{@content_item.dig("details", "department_counts", "non_ministerial_departments")}.+Non-ministerial departments/m) - assert page.has_selector?(".gem-c-big-number", text: /#{@content_item.dig("details", "department_counts", "agencies_and_other_public_bodies")}.+Agencies and other public bodies/m) + assert page.has_selector?(".gem-c-big-number", text: /#{@content_item.dig('details', 'department_counts', 'ministerial_departments')}.+Ministerial departments/m) + assert page.has_selector?(".gem-c-big-number", text: /#{@content_item.dig('details', 'department_counts', 'non_ministerial_departments')}.+Non-ministerial departments/m) + assert page.has_selector?(".gem-c-big-number", text: /#{@content_item.dig('details', 'department_counts', 'agencies_and_other_public_bodies')}.+Agencies and other public bodies/m) end test "does not include the count of ministers during a reshuffle" do diff --git a/test/presenters/service_manual_topic_presenter_test.rb b/test/presenters/service_manual_topic_presenter_test.rb index fc70dcd9b..ea30238b1 100644 --- a/test/presenters/service_manual_topic_presenter_test.rb +++ b/test/presenters/service_manual_topic_presenter_test.rb @@ -35,7 +35,7 @@ def schema_name first_accordion_section = { heading: { text: "Group 1" }, summary: { text: "The first group" }, - content: { html: "" }, + content: { html: "" }, expanded: true, } diff --git a/test/test_helper.rb b/test/test_helper.rb index 5eeb5b776..2fc49add9 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -103,7 +103,7 @@ def assert_has_publisher_metadata_other(any_args) def assert_has_metadata(any_args, extra_metadata_classes: nil) within ".gem-c-metadata#{extra_metadata_classes}" do - any_args.each do |_key, value| + any_args.each_value do |value| value = { value => nil } if value.is_a?(String) value.each do |text, href| if href