From 86796eba499e3927e360f331ad838b93c4b79483 Mon Sep 17 00:00:00 2001
From: Tyranja <tyranja@uber.space>
Date: Sun, 3 Nov 2024 10:12:17 +0100
Subject: [PATCH] update ruby from 3.1 to 3.2.2 (#1413)

* update ruby from 3.1 to 3.2.2

* new config naming for pagy

* fix invisible captcha
---
 .tool-versions                              |   2 +-
 Dockerfile                                  |   2 +-
 Gemfile                                     |   6 +-
 Gemfile.lock                                | 285 +++++++++++---------
 config/initializers/invisible_captcha.rb    |   1 +
 config/initializers/pagy.rb                 |   2 +-
 spec/controllers/contact_controller_spec.rb |  11 +-
 7 files changed, 166 insertions(+), 143 deletions(-)

diff --git a/.tool-versions b/.tool-versions
index 13369f6ff..f2a971aa7 100644
--- a/.tool-versions
+++ b/.tool-versions
@@ -1 +1 @@
-ruby 3.1.6
+ruby 3.2.2
diff --git a/Dockerfile b/Dockerfile
index b4d6a7430..f65a945e9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM ruby:3.1.6
+FROM ruby:3.2.2
 RUN apt-get update -qq && apt-get install -y nodejs postgresql-client
 RUN mkdir /speakerinnen_liste
 WORKDIR /speakerinnen_liste
diff --git a/Gemfile b/Gemfile
index ad83ec8a3..e26d9d626 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,7 +1,7 @@
 # frozen_string_literal: true
 
 source 'https://rubygems.org'
-ruby '3.1.6'
+ruby '3.2.2'
 gem 'rails', '6.1.7.6'
 
 # Needed for Javascript Runtime
@@ -22,11 +22,11 @@ gem 'mime-types'
 
 gem 'acts-as-taggable-on', '~> 9.0', '>= 9.0.1'
 gem 'devise', '~> 4.7'
-gem 'invisible_captcha'
+gem 'invisible_captcha', '2.3'
 gem 'jquery-rails', '~> 4.4.0'
 gem 'jquery-ui-rails', '~> 7.0.0'
 gem 'mini_magick', '~> 4.9.5'
-gem 'pg', '~> 1.1.3'
+gem 'pg', '~> 1.5.9'
 gem 'simple_form'
 
 gem 'country_select'
diff --git a/Gemfile.lock b/Gemfile.lock
index 356a66a37..fbef6b4b2 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,10 +1,10 @@
 GIT
   remote: https://github.com/globalize/globalize
-  revision: 3c146abbba4200aed1bbdbf3e63d5729a9dd95a1
+  revision: 278b9f95feef3838d434226c8a3836cb4e7880ec
   specs:
-    globalize (6.2.1)
-      activemodel (>= 4.2, < 7.1)
-      activerecord (>= 4.2, < 7.1)
+    globalize (6.3.0)
+      activemodel (>= 4.2, < 7.2)
+      activerecord (>= 4.2, < 7.2)
       request_store (~> 1.0)
 
 GEM
@@ -48,9 +48,9 @@ GEM
       erubi (~> 1.4)
       rails-dom-testing (~> 2.0)
       rails-html-sanitizer (~> 1.1, >= 1.2.0)
-    active_model_serializers (0.10.13)
-      actionpack (>= 4.1, < 7.1)
-      activemodel (>= 4.1, < 7.1)
+    active_model_serializers (0.10.14)
+      actionpack (>= 4.1)
+      activemodel (>= 4.1)
       case_transform (>= 0.2)
       jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
     activejob (6.1.7.6)
@@ -76,54 +76,56 @@ GEM
       zeitwerk (~> 2.3)
     acts-as-taggable-on (9.0.1)
       activerecord (>= 6.0, < 7.1)
-    addressable (2.8.1)
-      public_suffix (>= 2.0.2, < 6.0)
+    addressable (2.8.7)
+      public_suffix (>= 2.0.2, < 7.0)
     ast (2.4.2)
-    autoprefixer-rails (10.4.13.0)
+    autoprefixer-rails (10.4.19.0)
       execjs (~> 2)
-    aws-eventstream (1.2.0)
-    aws-partitions (1.735.0)
-    aws-sdk-core (3.171.0)
-      aws-eventstream (~> 1, >= 1.0.2)
-      aws-partitions (~> 1, >= 1.651.0)
-      aws-sigv4 (~> 1.5)
+    aws-eventstream (1.3.0)
+    aws-partitions (1.1001.0)
+    aws-sdk-core (3.211.0)
+      aws-eventstream (~> 1, >= 1.3.0)
+      aws-partitions (~> 1, >= 1.992.0)
+      aws-sigv4 (~> 1.9)
       jmespath (~> 1, >= 1.6.1)
-    aws-sdk-kms (1.63.0)
-      aws-sdk-core (~> 3, >= 3.165.0)
-      aws-sigv4 (~> 1.1)
-    aws-sdk-s3 (1.119.2)
-      aws-sdk-core (~> 3, >= 3.165.0)
+    aws-sdk-kms (1.95.0)
+      aws-sdk-core (~> 3, >= 3.210.0)
+      aws-sigv4 (~> 1.5)
+    aws-sdk-s3 (1.169.0)
+      aws-sdk-core (~> 3, >= 3.210.0)
       aws-sdk-kms (~> 1)
-      aws-sigv4 (~> 1.4)
-    aws-sigv4 (1.5.2)
+      aws-sigv4 (~> 1.5)
+    aws-sigv4 (1.10.1)
       aws-eventstream (~> 1, >= 1.0.2)
-    bcrypt (3.1.18)
-    benchmark-ips (2.12.0)
-    better_errors (2.9.1)
-      coderay (>= 1.0.0)
+    base64 (0.2.0)
+    bcrypt (3.1.20)
+    benchmark-ips (2.14.0)
+    better_errors (2.10.1)
       erubi (>= 1.0.0)
       rack (>= 0.9.0)
+      rouge (>= 1.0.0)
+    bigdecimal (3.1.8)
     bootsnap (1.4.9)
       msgpack (~> 1.0)
     bootstrap (4.3.1)
       autoprefixer-rails (>= 9.1.0)
       popper_js (>= 1.14.3, < 2)
       sassc-rails (>= 2.0.0)
-    bootstrap-icons (1.0.13)
+    bootstrap-icons (1.0.14)
       nokogiri (~> 1)
     bootstrap-icons-helper (2.0.1)
       bootstrap-icons (~> 1)
       rails (>= 6)
     builder (3.3.0)
-    bullet (7.0.7)
+    bullet (7.2.0)
       activesupport (>= 3.0.0)
       uniform_notifier (~> 1.11)
     byebug (11.1.3)
-    capybara (3.38.0)
+    capybara (3.40.0)
       addressable
       matrix
       mini_mime (>= 0.1.3)
-      nokogiri (~> 1.8)
+      nokogiri (~> 1.11)
       rack (>= 1.6.0)
       rack-test (>= 0.6.3)
       regexp_parser (>= 1.5, < 3.0)
@@ -134,60 +136,69 @@ GEM
       ffi (~> 1.0, >= 1.0.11)
     cliver (0.3.2)
     coderay (1.1.3)
-    concurrent-ruby (1.3.3)
-    countries (5.3.1)
+    concurrent-ruby (1.3.4)
+    countries (7.0.0)
       unaccent (~> 0.3)
-    country_select (8.0.1)
-      countries (~> 5.0)
+    country_select (10.0.0)
+      countries (> 5.0, < 8.0)
     crass (1.0.6)
     dalli (3.2.8)
     database_cleaner (1.7.0)
-    date (3.3.3)
-    dead_end (4.0.0)
-    derailed_benchmarks (2.1.2)
+    date (3.4.0)
+    derailed_benchmarks (2.2.1)
+      base64
       benchmark-ips (~> 2)
-      dead_end
-      get_process_mem (~> 0)
+      bigdecimal
+      drb
+      get_process_mem
       heapy (~> 0)
+      logger
       memory_profiler (>= 0, < 2)
       mini_histogram (>= 0.3.0)
+      mutex_m
+      ostruct
       rack (>= 1)
       rack-test
       rake (> 10, < 14)
-      ruby-statistics (>= 2.1)
+      ruby-statistics (>= 4.0.1)
+      ruby2_keywords
       thor (>= 0.19, < 2)
-    devise (4.9.0)
+    devise (4.9.4)
       bcrypt (~> 3.0)
       orm_adapter (~> 0.1)
       railties (>= 4.1.0)
       responders
       warden (~> 1.2.3)
-    diff-lcs (1.5.0)
+    diff-lcs (1.5.1)
+    drb (2.2.1)
     erubi (1.13.0)
     exception_notification (4.5.0)
       actionmailer (>= 5.2, < 8)
       activesupport (>= 5.2, < 8)
-    execjs (2.8.1)
-    factory_bot (6.2.1)
+    execjs (2.10.0)
+    factory_bot (6.5.0)
       activesupport (>= 5.0.0)
-    factory_bot_rails (6.2.0)
-      factory_bot (~> 6.2.0)
+    factory_bot_rails (6.4.4)
+      factory_bot (~> 6.5)
       railties (>= 5.0.0)
-    faker (3.1.1)
+    faker (3.5.1)
       i18n (>= 1.8.11, < 2)
-    ffi (1.15.5)
+    ffi (1.17.0-aarch64-linux-gnu)
+    ffi (1.17.0-arm64-darwin)
+    ffi (1.17.0-x86_64-linux-gnu)
     font-awesome-rails (4.7.0.8)
       railties (>= 3.2, < 8.0)
     formatador (1.1.0)
-    friendly_id (5.5.0)
+    friendly_id (5.5.1)
       activerecord (>= 4.0.0)
-    get_process_mem (0.2.7)
+    get_process_mem (1.0.0)
+      bigdecimal (>= 2.0)
       ffi (~> 1.0)
-    globalid (1.1.0)
-      activesupport (>= 5.0)
+    globalid (1.2.1)
+      activesupport (>= 6.1)
     globalize-accessors (0.3.0)
       globalize (>= 5.0.0)
-    guard (2.18.0)
+    guard (2.19.0)
       formatador (>= 0.2.4)
       listen (>= 2.7, < 4.0)
       lumberjack (>= 1.0.12, < 2.0)
@@ -203,16 +214,17 @@ GEM
       rspec (>= 2.99.0, < 4.0)
     heapy (0.2.0)
       thor
-    honeybadger (5.14.1)
-    i18n (1.14.5)
+    honeybadger (5.19.1)
+      logger
+    i18n (1.14.6)
       concurrent-ruby (~> 1.0)
-    image_processing (1.12.2)
+    image_processing (1.13.0)
       mini_magick (>= 4.9.5, < 5)
       ruby-vips (>= 2.0.17, < 3)
     interactor (3.1.2)
-    invisible_captcha (2.1.0)
+    invisible_captcha (2.3.0)
       rails (>= 5.2)
-    jaro_winkler (1.5.4)
+    jaro_winkler (1.5.6)
     jmespath (1.6.2)
     jquery-rails (4.4.0)
       rails-dom-testing (>= 1, < 3)
@@ -224,47 +236,53 @@ GEM
     kgio (2.11.4)
     launchy (2.5.2)
       addressable (~> 2.8)
-    letter_opener (1.8.1)
-      launchy (>= 2.2, < 3)
-    libv8-node (16.10.0.0-arm64-darwin)
-    libv8-node (16.10.0.0-x86_64-linux)
-    listen (3.8.0)
+    letter_opener (1.10.0)
+      launchy (>= 2.2, < 4)
+    libv8-node (18.19.0.0-aarch64-linux)
+    libv8-node (18.19.0.0-arm64-darwin)
+    libv8-node (18.19.0.0-x86_64-linux)
+    listen (3.9.0)
       rb-fsevent (~> 0.10, >= 0.10.3)
       rb-inotify (~> 0.9, >= 0.9.10)
-    loofah (2.22.0)
+    logger (1.6.1)
+    loofah (2.23.1)
       crass (~> 1.0.2)
       nokogiri (>= 1.12.0)
-    lumberjack (1.2.8)
+    lumberjack (1.2.10)
     mail (2.8.1)
       mini_mime (>= 0.1.1)
       net-imap
       net-pop
       net-smtp
-    marcel (1.0.2)
+    marcel (1.0.4)
     matrix (0.4.2)
-    memory_profiler (1.0.1)
+    memory_profiler (1.1.0)
     method_source (1.1.0)
-    mime-types (3.4.1)
+    mime-types (3.6.0)
+      logger
       mime-types-data (~> 3.2015)
-    mime-types-data (3.2023.0218.1)
+    mime-types-data (3.2024.1001)
     mini_histogram (0.3.1)
     mini_magick (4.9.5)
-    mini_mime (1.1.2)
-    mini_racer (0.6.3)
-      libv8-node (~> 16.10.0.0)
+    mini_mime (1.1.5)
+    mini_racer (0.16.0)
+      libv8-node (~> 18.19.0.0)
     minitest (5.11.3)
-    msgpack (1.6.1)
+    msgpack (1.7.3)
+    mutex_m (0.2.0)
     nenv (0.3.0)
-    net-imap (0.3.4)
+    net-imap (0.5.0)
       date
       net-protocol
     net-pop (0.1.2)
       net-protocol
-    net-protocol (0.2.1)
+    net-protocol (0.2.2)
       timeout
-    net-smtp (0.3.3)
+    net-smtp (0.5.0)
       net-protocol
-    nio4r (2.5.9)
+    nio4r (2.7.4)
+    nokogiri (1.16.7-aarch64-linux)
+      racc (~> 1.4)
     nokogiri (1.16.7-arm64-darwin)
       racc (~> 1.4)
     nokogiri (1.16.7-x86_64-linux)
@@ -274,14 +292,16 @@ GEM
       nenv (~> 0.1)
       shellany (~> 0.0)
     orm_adapter (0.5.0)
-    pagy (6.1.0)
-    parallel (1.22.1)
-    parser (3.2.1.1)
+    ostruct (0.6.0)
+    pagy (9.1.1)
+    parallel (1.26.3)
+    parser (3.3.5.1)
       ast (~> 2.4.1)
-    pg (1.1.4)
-    pg_search (2.3.6)
-      activerecord (>= 5.2)
-      activesupport (>= 5.2)
+      racc
+    pg (1.5.9)
+    pg_search (2.3.7)
+      activerecord (>= 6.1)
+      activesupport (>= 6.1)
     poltergeist (1.18.1)
       capybara (>= 2.1, < 4)
       cliver (~> 0.3.1)
@@ -291,10 +311,10 @@ GEM
     pry (0.14.2)
       coderay (~> 1.1)
       method_source (~> 1.0)
-    psych (3.3.3)
-    public_suffix (5.0.1)
+    psych (3.3.4)
+    public_suffix (6.0.1)
     racc (1.8.1)
-    rack (2.2.9)
+    rack (2.2.10)
     rack-attack (6.7.0)
       rack (>= 1.0, < 4)
     rack-piwik (0.3.0)
@@ -337,38 +357,39 @@ GEM
     raindrops (0.20.1)
     rake (13.2.1)
     rb-fsevent (0.11.2)
-    rb-inotify (0.10.1)
+    rb-inotify (0.11.1)
       ffi (~> 1.0)
     record_tag_helper (1.0.1)
       actionview (>= 5)
-    regexp_parser (2.7.0)
-    request_store (1.5.1)
+    regexp_parser (2.9.2)
+    request_store (1.7.0)
       rack (>= 1.4)
-    responders (3.1.0)
+    responders (3.1.1)
       actionpack (>= 5.2)
       railties (>= 5.2)
     rexml (3.3.9)
-    rspec (3.12.0)
-      rspec-core (~> 3.12.0)
-      rspec-expectations (~> 3.12.0)
-      rspec-mocks (~> 3.12.0)
-    rspec-core (3.12.1)
-      rspec-support (~> 3.12.0)
-    rspec-expectations (3.12.2)
+    rouge (4.4.0)
+    rspec (3.13.0)
+      rspec-core (~> 3.13.0)
+      rspec-expectations (~> 3.13.0)
+      rspec-mocks (~> 3.13.0)
+    rspec-core (3.13.2)
+      rspec-support (~> 3.13.0)
+    rspec-expectations (3.13.3)
       diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.12.0)
-    rspec-mocks (3.12.4)
+      rspec-support (~> 3.13.0)
+    rspec-mocks (3.13.2)
       diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.12.0)
-    rspec-rails (5.1.2)
-      actionpack (>= 5.2)
-      activesupport (>= 5.2)
-      railties (>= 5.2)
-      rspec-core (~> 3.10)
-      rspec-expectations (~> 3.10)
-      rspec-mocks (~> 3.10)
-      rspec-support (~> 3.10)
-    rspec-support (3.12.0)
+      rspec-support (~> 3.13.0)
+    rspec-rails (6.1.5)
+      actionpack (>= 6.1)
+      activesupport (>= 6.1)
+      railties (>= 6.1)
+      rspec-core (~> 3.13)
+      rspec-expectations (~> 3.13)
+      rspec-mocks (~> 3.13)
+      rspec-support (~> 3.13)
+    rspec-support (3.13.1)
     rubocop (0.62.0)
       jaro_winkler (~> 1.5.1)
       parallel (~> 1.10)
@@ -378,9 +399,11 @@ GEM
       ruby-progressbar (~> 1.7)
       unicode-display_width (~> 1.4.0)
     ruby-progressbar (1.13.0)
-    ruby-statistics (3.0.1)
-    ruby-vips (2.1.4)
+    ruby-statistics (4.0.1)
+    ruby-vips (2.2.2)
       ffi (~> 1.12)
+      logger
+    ruby2_keywords (0.0.5)
     rubyzip (1.3.0)
     sassc (2.4.0)
       ffi (~> 1.9)
@@ -394,42 +417,44 @@ GEM
       childprocess (~> 0.5)
       rubyzip (~> 1.2, >= 1.2.2)
     shellany (0.0.1)
-    simple_form (5.2.0)
+    simple_form (5.3.1)
       actionpack (>= 5.2)
       activemodel (>= 5.2)
-    sprockets (4.2.0)
+    sprockets (4.2.1)
       concurrent-ruby (~> 1.0)
       rack (>= 2.2.4, < 4)
-    sprockets-rails (3.4.2)
-      actionpack (>= 5.2)
-      activesupport (>= 5.2)
+    sprockets-rails (3.5.2)
+      actionpack (>= 6.1)
+      activesupport (>= 6.1)
       sprockets (>= 3.0.0)
-    stackprof (0.2.24)
-    thor (1.3.1)
-    tilt (2.1.0)
-    timeout (0.3.2)
+    stackprof (0.2.26)
+    thor (1.3.2)
+    tilt (2.4.0)
+    timeout (0.4.1)
     tzinfo (2.0.6)
       concurrent-ruby (~> 1.0)
-    uglifier (4.2.0)
+    uglifier (4.2.1)
       execjs (>= 0.3.0, < 3)
     unaccent (0.4.0)
     unicode-display_width (1.4.1)
-    unicorn (5.8.0)
+    unicorn (6.1.0)
       kgio (~> 2.6)
       raindrops (~> 0.7)
     uniform_notifier (1.16.0)
     warden (1.2.9)
       rack (>= 2.0.9)
-    webrick (1.8.1)
-    websocket-driver (0.7.5)
+    webrick (1.9.0)
+    websocket-driver (0.7.6)
       websocket-extensions (>= 0.1.0)
     websocket-extensions (0.1.5)
     xpath (3.2.0)
       nokogiri (~> 1.8)
-    zeitwerk (2.6.17)
+    zeitwerk (2.7.1)
 
 PLATFORMS
+  aarch64-linux
   arm64-darwin-22
+  arm64-darwin-23
   x86_64-linux
 
 DEPENDENCIES
@@ -460,7 +485,7 @@ DEPENDENCIES
   honeybadger (~> 5.14)
   image_processing (~> 1.2)
   interactor
-  invisible_captcha
+  invisible_captcha (= 2.3)
   jquery-rails (~> 4.4.0)
   jquery-ui-rails (~> 7.0.0)
   letter_opener
@@ -470,7 +495,7 @@ DEPENDENCIES
   minitest (= 5.11.3)
   normalize-rails
   pagy
-  pg (~> 1.1.3)
+  pg (~> 1.5.9)
   pg_search
   poltergeist (= 1.18.1)
   pry
@@ -493,7 +518,7 @@ DEPENDENCIES
   webrick (~> 1.7)
 
 RUBY VERSION
-   ruby 3.1.6p260
+   ruby 3.2.2p53
 
 BUNDLED WITH
    2.4.10
diff --git a/config/initializers/invisible_captcha.rb b/config/initializers/invisible_captcha.rb
index d35d30ef7..3d253c356 100644
--- a/config/initializers/invisible_captcha.rb
+++ b/config/initializers/invisible_captcha.rb
@@ -1,5 +1,6 @@
 InvisibleCaptcha.setup do |config|
   if Rails.env.test?
     config.timestamp_enabled = false
+    config.spinner_enabled = false
   end
 end
diff --git a/config/initializers/pagy.rb b/config/initializers/pagy.rb
index 8159be40c..b611b895e 100644
--- a/config/initializers/pagy.rb
+++ b/config/initializers/pagy.rb
@@ -14,7 +14,7 @@
 # Instance variables
 # See https://ddnexus.github.io/pagy/docs/api/pagy#instance-variables
 # Pagy::DEFAULT[:page]   = 1                                  # default
-Pagy::DEFAULT[:items]  = 24                                 # default
+Pagy::DEFAULT[:limit]  = 24                                 # default
 # Pagy::DEFAULT[:outset] = 0                                  # default
 
 
diff --git a/spec/controllers/contact_controller_spec.rb b/spec/controllers/contact_controller_spec.rb
index 9ce43553a..991b5979e 100644
--- a/spec/controllers/contact_controller_spec.rb
+++ b/spec/controllers/contact_controller_spec.rb
@@ -1,20 +1,18 @@
 # frozen_string_literal: true
 
 describe ContactController, type: :controller do
-  include AuthHelper
-
   let!(:ada) { create(:published_profile, email: "ada@mail.org", main_topic_en: 'math') }
 
   describe 'create action' do
     it 'when profile active' do
-      get :create, params: { id: ada.id, message: { name: "Maxi"} }
+      post :create, params: { id: ada.id, message: { name: "Maxi"} }
       expect(response).to be_successful
       expect(response.response_code).to eq(200)
     end
 
     it 'when profile inactive' do
       ada.update!(inactive: true)
-      get :create, params: { id: ada.id, message: { name: "Maxi"} }
+      post :create, params: { id: ada.id, message: { name: "Maxi"} }
       expect(response).not_to be_successful
       expect(response.response_code).to eq(302)
       expect(response).to redirect_to("/#{I18n.locale}/profiles")
@@ -22,11 +20,10 @@
 
     it 'when unpublished profiles' do
       ada.update!(published: false)
-      get :create, params: { id: ada.id, message: { name: "Maxi"} }
+      post :create, params: { id: ada.id, message: { name: "Maxi"} }
       expect(response).not_to be_successful
       expect(response.response_code).to eq(302)
       expect(response).to redirect_to("/#{I18n.locale}/profiles")
     end
   end
-end
-
+end
\ No newline at end of file