From 8ddfd903f3418f07b6249cdb8247bd180b451d88 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Sun, 12 Feb 2023 19:04:07 +0100 Subject: [PATCH 1/7] Bump rails to 7.0.4.2 --- Gemfile | 2 +- Gemfile.lock | 132 +++++++++++++++++++++++++++------------------------ 2 files changed, 71 insertions(+), 63 deletions(-) diff --git a/Gemfile b/Gemfile index 63e2ae23..810499c5 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source "https://rubygems.org" gem "i18n-js", "4.0" -gem "rails", "~> 6.1" +gem "rails", "~> 7.0" gem "rails-i18n", "~> 7.0" gem "cssbundling-rails", "~> 1.3" diff --git a/Gemfile.lock b/Gemfile.lock index c9dfd28f..adbc4b05 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,40 +17,47 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7.6) - actionpack (= 6.1.7.6) - activesupport (= 6.1.7.6) + actioncable (7.0.4.2) + actionpack (= 7.0.4.2) + activesupport (= 7.0.4.2) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.6) - actionpack (= 6.1.7.6) - activejob (= 6.1.7.6) - activerecord (= 6.1.7.6) - activestorage (= 6.1.7.6) - activesupport (= 6.1.7.6) + actionmailbox (7.0.4.2) + actionpack (= 7.0.4.2) + activejob (= 7.0.4.2) + activerecord (= 7.0.4.2) + activestorage (= 7.0.4.2) + activesupport (= 7.0.4.2) mail (>= 2.7.1) - actionmailer (6.1.7.6) - actionpack (= 6.1.7.6) - actionview (= 6.1.7.6) - activejob (= 6.1.7.6) - activesupport (= 6.1.7.6) + net-imap + net-pop + net-smtp + actionmailer (7.0.4.2) + actionpack (= 7.0.4.2) + actionview (= 7.0.4.2) + activejob (= 7.0.4.2) + activesupport (= 7.0.4.2) mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp rails-dom-testing (~> 2.0) - actionpack (6.1.7.6) - actionview (= 6.1.7.6) - activesupport (= 6.1.7.6) - rack (~> 2.0, >= 2.0.9) + actionpack (7.0.4.2) + actionview (= 7.0.4.2) + activesupport (= 7.0.4.2) + rack (~> 2.0, >= 2.2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7.6) - actionpack (= 6.1.7.6) - activerecord (= 6.1.7.6) - activestorage (= 6.1.7.6) - activesupport (= 6.1.7.6) + actiontext (7.0.4.2) + actionpack (= 7.0.4.2) + activerecord (= 7.0.4.2) + activestorage (= 7.0.4.2) + activesupport (= 7.0.4.2) + globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (6.1.7.6) - activesupport (= 6.1.7.6) + actionview (7.0.4.2) + activesupport (= 7.0.4.2) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -58,26 +65,26 @@ GEM active_model_otp (2.3.2) activemodel rotp (~> 6.2.0) - activejob (6.1.7.6) - activesupport (= 6.1.7.6) + activejob (7.0.4.2) + activesupport (= 7.0.4.2) globalid (>= 0.3.6) - activemodel (6.1.7.6) - activesupport (= 6.1.7.6) + activemodel (7.0.4.2) + activesupport (= 7.0.4.2) activemodel-serializers-xml (1.0.2) activemodel (> 5.x) activesupport (> 5.x) builder (~> 3.1) - activerecord (6.1.7.6) - activemodel (= 6.1.7.6) - activesupport (= 6.1.7.6) - activestorage (6.1.7.6) - actionpack (= 6.1.7.6) - activejob (= 6.1.7.6) - activerecord (= 6.1.7.6) - activesupport (= 6.1.7.6) + activerecord (7.0.4.2) + activemodel (= 7.0.4.2) + activesupport (= 7.0.4.2) + activestorage (7.0.4.2) + actionpack (= 7.0.4.2) + activejob (= 7.0.4.2) + activerecord (= 7.0.4.2) + activesupport (= 7.0.4.2) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7.6) + activesupport (7.0.4.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -159,7 +166,7 @@ GEM zeitwerk (~> 2.6) erubi (1.12.0) excon (0.104.0) - factory_bot (6.2.0) + factory_bot (6.2.1) activesupport (>= 5.0.0) factory_bot_rails (6.2.0) factory_bot (~> 6.2.0) @@ -188,7 +195,7 @@ GEM fog-core nokogiri (>= 1.5.11, < 2.0.0) formatador (1.1.0) - glob (0.3.1) + glob (0.4.0) globalid (1.2.1) activesupport (>= 6.1) haml (6.2.3) @@ -211,7 +218,7 @@ GEM i18n-js (4.0.0) glob i18n - idn-ruby (0.1.4) + idn-ruby (0.1.5) image_processing (1.12.2) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) @@ -234,8 +241,8 @@ GEM kaminari-core (= 1.2.2) kaminari-core (1.2.2) language_server-protocol (3.17.0.3) - launchy (2.5.0) - addressable (~> 2.7) + launchy (2.5.2) + addressable (~> 2.8) letter_opener (1.8.1) launchy (>= 2.2, < 3) lograge (0.14.0) @@ -302,20 +309,20 @@ GEM rack (2.2.8) rack-test (2.1.0) rack (>= 1.3) - rails (6.1.7.6) - actioncable (= 6.1.7.6) - actionmailbox (= 6.1.7.6) - actionmailer (= 6.1.7.6) - actionpack (= 6.1.7.6) - actiontext (= 6.1.7.6) - actionview (= 6.1.7.6) - activejob (= 6.1.7.6) - activemodel (= 6.1.7.6) - activerecord (= 6.1.7.6) - activestorage (= 6.1.7.6) - activesupport (= 6.1.7.6) + rails (7.0.4.2) + actioncable (= 7.0.4.2) + actionmailbox (= 7.0.4.2) + actionmailer (= 7.0.4.2) + actionpack (= 7.0.4.2) + actiontext (= 7.0.4.2) + actionview (= 7.0.4.2) + activejob (= 7.0.4.2) + activemodel (= 7.0.4.2) + activerecord (= 7.0.4.2) + activestorage (= 7.0.4.2) + activesupport (= 7.0.4.2) bundler (>= 1.15.0) - railties (= 6.1.7.6) + railties (= 7.0.4.2) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) @@ -337,16 +344,17 @@ GEM nested_form (~> 0.3) rails (>= 6.0, < 8) turbo-rails (~> 1.0) - railties (6.1.7.6) - actionpack (= 6.1.7.6) - activesupport (= 6.1.7.6) + railties (7.0.4.2) + actionpack (= 7.0.4.2) + activesupport (= 7.0.4.2) method_source rake (>= 12.2) thor (~> 1.0) + zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) redcarpet (3.6.0) - redis (4.8.0) + redis (4.8.1) regexp_parser (2.8.2) request_store (1.5.1) rack (>= 1.4) @@ -482,7 +490,7 @@ GEM concurrent-ruby (~> 1.0) unf (0.1.4) unf_ext - unf_ext (0.0.8) + unf_ext (0.0.8.2) unicode-display_width (2.5.0) uniform_notifier (1.16.0) warden (1.2.9) @@ -547,7 +555,7 @@ DEPENDENCIES puma pundit (~> 2.3) questiongenerator (~> 1.1) - rails (~> 6.1) + rails (~> 7.0) rails-controller-testing rails-i18n (~> 7.0) rails_admin From 488ab85653a2df4b5fd048493d58ebaaf611327c Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Sun, 12 Feb 2023 19:05:05 +0100 Subject: [PATCH 2/7] Adjust autoloading --- config/application.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/application.rb b/config/application.rb index e832eb9e..a92cf4cb 100644 --- a/config/application.rb +++ b/config/application.rb @@ -27,12 +27,14 @@ module Justask # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. - config.load_defaults 6.0 + config.load_defaults 7.0 # add `lib/` to the autoload paths so zeitwerk can find e.g. our `UseCase`s # without an explicit `require`, and also take care of hot reloading the code # (really useful in development!) - config.autoload_paths << config.root.join("lib") + config.autoload_once_paths << config.root.join("lib") config.eager_load_paths << config.root.join("lib") + # This lowers memory usage from Bootsnap + config.add_autoload_paths_to_load_path = false # Use Sidekiq for background jobs config.active_job.queue_adapter = :sidekiq From 6e7c625f3fbb92f780157a486d29b2c5d1710a0c Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Sun, 12 Feb 2023 19:05:15 +0100 Subject: [PATCH 3/7] Stub out Trix editor --- app/assets/config/actiontext.js | 1 + app/assets/config/trix.js | 1 + app/assets/stylesheets/trix.scss | 1 + 3 files changed, 3 insertions(+) create mode 100644 app/assets/config/actiontext.js create mode 100644 app/assets/config/trix.js create mode 100644 app/assets/stylesheets/trix.scss diff --git a/app/assets/config/actiontext.js b/app/assets/config/actiontext.js new file mode 100644 index 00000000..9da9b2bc --- /dev/null +++ b/app/assets/config/actiontext.js @@ -0,0 +1 @@ +// This is a stub so that we don't have to install actiontext diff --git a/app/assets/config/trix.js b/app/assets/config/trix.js new file mode 100644 index 00000000..915e526b --- /dev/null +++ b/app/assets/config/trix.js @@ -0,0 +1 @@ +// This is a stub so that we don't have to install Trix diff --git a/app/assets/stylesheets/trix.scss b/app/assets/stylesheets/trix.scss new file mode 100644 index 00000000..915e526b --- /dev/null +++ b/app/assets/stylesheets/trix.scss @@ -0,0 +1 @@ +// This is a stub so that we don't have to install Trix From 23dc19a665fda5a62cd35eaaf820070b93fa901c Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Tue, 14 Feb 2023 12:47:09 +0100 Subject: [PATCH 4/7] Add cookie rotation for switching from SHA1 to SHA256 --- config/initializers/cookie_rotator.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 config/initializers/cookie_rotator.rb diff --git a/config/initializers/cookie_rotator.rb b/config/initializers/cookie_rotator.rb new file mode 100644 index 00000000..65a33147 --- /dev/null +++ b/config/initializers/cookie_rotator.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +Rails.application.config.after_initialize do + Rails.application.config.action_dispatch.cookies_rotations.tap do |cookies| + salt = Rails.application.config.action_dispatch.authenticated_encrypted_cookie_salt + secret_key_base = Rails.application.secret_key_base + + key_generator = ActiveSupport::KeyGenerator.new( + secret_key_base, iterations: 1000, hash_digest_class: OpenSSL::Digest::SHA1 + ) + key_len = ActiveSupport::MessageEncryptor.key_len + secret = key_generator.generate_key(salt, key_len) + + cookies.rotate :encrypted, secret + end +end From 13e6943fc6eda3ba47b2dd11efa6fcd4e7ae5cbc Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Fri, 20 Oct 2023 09:39:52 +0200 Subject: [PATCH 5/7] Bump rails to 7.0.8 --- Gemfile | 2 +- Gemfile.lock | 154 +++++++++++++++++++++++++-------------------------- 2 files changed, 77 insertions(+), 79 deletions(-) diff --git a/Gemfile b/Gemfile index 810499c5..e1d1eb41 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source "https://rubygems.org" gem "i18n-js", "4.0" -gem "rails", "~> 7.0" +gem "rails", "~> 7.0.8" gem "rails-i18n", "~> 7.0" gem "cssbundling-rails", "~> 1.3" diff --git a/Gemfile.lock b/Gemfile.lock index adbc4b05..ce5431b3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,47 +17,47 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.0.4.2) - actionpack (= 7.0.4.2) - activesupport (= 7.0.4.2) + actioncable (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4.2) - actionpack (= 7.0.4.2) - activejob (= 7.0.4.2) - activerecord (= 7.0.4.2) - activestorage (= 7.0.4.2) - activesupport (= 7.0.4.2) + actionmailbox (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.4.2) - actionpack (= 7.0.4.2) - actionview (= 7.0.4.2) - activejob (= 7.0.4.2) - activesupport (= 7.0.4.2) + actionmailer (7.0.8) + actionpack (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activesupport (= 7.0.8) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.4.2) - actionview (= 7.0.4.2) - activesupport (= 7.0.4.2) - rack (~> 2.0, >= 2.2.0) + actionpack (7.0.8) + actionview (= 7.0.8) + activesupport (= 7.0.8) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4.2) - actionpack (= 7.0.4.2) - activerecord (= 7.0.4.2) - activestorage (= 7.0.4.2) - activesupport (= 7.0.4.2) + actiontext (7.0.8) + actionpack (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4.2) - activesupport (= 7.0.4.2) + actionview (7.0.8) + activesupport (= 7.0.8) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -65,31 +65,30 @@ GEM active_model_otp (2.3.2) activemodel rotp (~> 6.2.0) - activejob (7.0.4.2) - activesupport (= 7.0.4.2) + activejob (7.0.8) + activesupport (= 7.0.8) globalid (>= 0.3.6) - activemodel (7.0.4.2) - activesupport (= 7.0.4.2) + activemodel (7.0.8) + activesupport (= 7.0.8) activemodel-serializers-xml (1.0.2) activemodel (> 5.x) activesupport (> 5.x) builder (~> 3.1) - activerecord (7.0.4.2) - activemodel (= 7.0.4.2) - activesupport (= 7.0.4.2) - activestorage (7.0.4.2) - actionpack (= 7.0.4.2) - activejob (= 7.0.4.2) - activerecord (= 7.0.4.2) - activesupport (= 7.0.4.2) + 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) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.4.2) + activesupport (7.0.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - zeitwerk (~> 2.3) addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) @@ -103,9 +102,9 @@ GEM debug_inspector (>= 0.0.1) bootsnap (1.16.0) msgpack (~> 1.2) - bootstrap_form (5.1.0) - actionpack (>= 5.2) - activemodel (>= 5.2) + bootstrap_form (5.3.2) + actionpack (>= 6.1) + activemodel (>= 6.1) builder (3.2.4) bullet (7.1.2) activesupport (>= 3.0.0) @@ -141,15 +140,15 @@ GEM devise-async (1.0.0) activejob (>= 5.0) devise (>= 4.0) - devise-i18n (1.10.3) - devise (>= 4.8.0) + devise-i18n (1.12.0) + devise (>= 4.9.0) diff-lcs (1.5.0) docile (1.4.0) dotenv (2.8.1) dotenv-rails (2.8.1) dotenv (= 2.8.1) railties (>= 3.2) - dry-core (1.0.0) + dry-core (1.0.1) concurrent-ruby (~> 1.0) zeitwerk (~> 2.6) dry-inflector (1.0.0) @@ -174,9 +173,9 @@ GEM fake_email_validator (1.0.11) activemodel mail - faker (3.1.1) + faker (3.2.1) i18n (>= 1.8.11, < 2) - ffi (1.15.5) + ffi (1.16.3) fog-aws (3.21.0) fog-core (~> 2.1) fog-json (~> 1.1) @@ -259,7 +258,7 @@ GEM method_source (1.0.0) mime-types (3.5.1) mime-types-data (~> 3.2015) - mime-types-data (3.2023.0808) + mime-types-data (3.2023.1003) mimemagic (0.4.3) nokogiri (~> 1) rake @@ -267,13 +266,13 @@ GEM mini_mime (1.1.5) mini_portile2 (2.8.4) minitest (5.20.0) - msgpack (1.6.0) + msgpack (1.7.2) multi_json (1.15.0) multi_xml (0.6.0) nested_form (0.3.2) - net-http-persistent (4.0.1) + net-http-persistent (4.0.2) connection_pool (~> 2.2) - net-http2 (0.18.4) + net-http2 (0.18.5) http-2 (~> 0.11) net-imap (0.4.1) date @@ -309,21 +308,20 @@ GEM rack (2.2.8) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.4.2) - actioncable (= 7.0.4.2) - actionmailbox (= 7.0.4.2) - actionmailer (= 7.0.4.2) - actionpack (= 7.0.4.2) - actiontext (= 7.0.4.2) - actionview (= 7.0.4.2) - activejob (= 7.0.4.2) - activemodel (= 7.0.4.2) - activerecord (= 7.0.4.2) - activestorage (= 7.0.4.2) - activesupport (= 7.0.4.2) + 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) bundler (>= 1.15.0) - railties (= 7.0.4.2) - sprockets-rails (>= 2.0.0) + railties (= 7.0.8) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -344,9 +342,9 @@ GEM nested_form (~> 0.3) rails (>= 6.0, < 8) turbo-rails (~> 1.0) - railties (7.0.4.2) - actionpack (= 7.0.4.2) - activesupport (= 7.0.4.2) + railties (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) method_source rake (>= 12.2) thor (~> 1.0) @@ -364,7 +362,7 @@ GEM rexml (3.2.6) rolify (6.0.1) rotp (6.2.2) - rouge (4.1.2) + rouge (4.1.3) rpush (7.0.1) activesupport (>= 5.2) jwt (>= 1.5.6) @@ -423,7 +421,7 @@ GEM rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) ruby-progressbar (1.13.0) - ruby-vips (2.1.4) + ruby-vips (2.2.0) ffi (~> 1.12) rubyzip (2.3.2) sanitize (6.1.0) @@ -437,17 +435,17 @@ GEM sprockets (> 3.0) sprockets-rails tilt - sentry-rails (5.10.0) + sentry-rails (5.12.0) railties (>= 5.0) - sentry-ruby (~> 5.10.0) - sentry-ruby (5.10.0) + sentry-ruby (~> 5.12.0) + sentry-ruby (5.12.0) concurrent-ruby (~> 1.0, >= 1.0.2) - sentry-sidekiq (5.10.0) - sentry-ruby (~> 5.10.0) + sentry-sidekiq (5.12.0) + sentry-ruby (~> 5.12.0) sidekiq (>= 3.0) shoulda-matchers (5.3.0) activesupport (>= 5.2.0) - sidekiq (6.5.8) + sidekiq (6.5.12) connection_pool (>= 2.2.5, < 3) rack (~> 2.0) redis (>= 4.5.0, < 5) @@ -473,7 +471,7 @@ GEM sprockets (>= 3.0.0) sysexits (1.2.0) temple (0.10.3) - thor (1.2.2) + thor (1.3.0) tilt (2.3.0) timeout (0.4.0) tldv (0.1.0) @@ -555,7 +553,7 @@ DEPENDENCIES puma pundit (~> 2.3) questiongenerator (~> 1.1) - rails (~> 7.0) + rails (~> 7.0.8) rails-controller-testing rails-i18n (~> 7.0) rails_admin From e21f5cb39d8f67ee6f4ab14cb61f0bcf5494d1ef Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Fri, 20 Oct 2023 09:41:03 +0200 Subject: [PATCH 6/7] Remove spring Spring is no longer included with Rails by default See https://rubyonrails.org/2021/12/15/Rails-7-fulfilling-a-vision#a-few-other-highlights --- Gemfile | 1 - Gemfile.lock | 2 -- 2 files changed, 3 deletions(-) diff --git a/Gemfile b/Gemfile index e1d1eb41..706e2ba6 100644 --- a/Gemfile +++ b/Gemfile @@ -70,7 +70,6 @@ gem "jwt", "~> 2.7" group :development do gem "binding_of_caller" - gem "spring", "~> 4.1" end gem "puma" diff --git a/Gemfile.lock b/Gemfile.lock index ce5431b3..0fdfc9eb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -461,7 +461,6 @@ GEM json simplecov simplecov_json_formatter (0.1.4) - spring (4.1.1) sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) @@ -580,7 +579,6 @@ DEPENDENCIES simplecov simplecov-cobertura simplecov-json - spring (~> 4.1) sprockets (~> 4.2) sprockets-rails tldv (~> 0.1.0) From dad0d72cca10acfe889f13b15b6103e6c30e0417 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Fri, 20 Oct 2023 09:52:48 +0200 Subject: [PATCH 7/7] Allow faker TLDs in testing --- app/validators/typoed_email_validator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/validators/typoed_email_validator.rb b/app/validators/typoed_email_validator.rb index 717fae97..73dbc446 100644 --- a/app/validators/typoed_email_validator.rb +++ b/app/validators/typoed_email_validator.rb @@ -56,7 +56,7 @@ class TypoedEmailValidator < ActiveModel::EachValidator # check if the TLD is valid tld = domain_parts.last - return false unless TLDv.valid?(tld) + return false unless TLDv.valid?(tld) || (Rails.env.test? && %w[example test].include?(tld)) # finally, common typos return false if INVALID_ENDINGS.any? { value.end_with?(_1) }