From c809adeeed523c5f2dc70ff2143d9671529b1911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Barri=C3=A9?= Date: Thu, 8 Jun 2023 11:35:45 +0200 Subject: [PATCH 1/2] Use show_exceptions = :none in Rails 7.1 DEPRECATION WARNING: Setting action_dispatch.show_exceptions to false is deprecated. Set to :none instead. --- test/rails_app/config/environments/test.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/rails_app/config/environments/test.rb b/test/rails_app/config/environments/test.rb index c5d393c5..9153790a 100644 --- a/test/rails_app/config/environments/test.rb +++ b/test/rails_app/config/environments/test.rb @@ -32,7 +32,11 @@ RailsApp::Application.configure do config.action_controller.perform_caching = false # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = false + if Devise::Test.rails71_and_up? + config.action_dispatch.show_exceptions = :none + else + config.action_dispatch.show_exceptions = false + end # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false From 48e115334b72b0b07f0f3a2cbe97dc48c0795850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Barri=C3=A9?= Date: Thu, 8 Jun 2023 11:46:18 +0200 Subject: [PATCH 2/2] Remove MigrationContext deprecation in 7.1 DEPRECATION WARNING: SchemaMigration no longer inherits from ActiveRecord::Base. If you want to use the default connection, remove this argument. If you want to use a specific connection, instantiate MigrationContext with the connection's schema migration, for example `MigrationContext.new(path, Dog.connection.schema_migration)`. --- test/orm/active_record.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/orm/active_record.rb b/test/orm/active_record.rb index cf500330..97bf37c5 100644 --- a/test/orm/active_record.rb +++ b/test/orm/active_record.rb @@ -5,7 +5,9 @@ ActiveRecord::Base.logger = Logger.new(nil) ActiveRecord::Base.include_root_in_json = true migrate_path = File.expand_path("../../rails_app/db/migrate/", __FILE__) -if Devise::Test.rails6_and_up? +if Devise::Test.rails71_and_up? + ActiveRecord::MigrationContext.new(migrate_path).migrate +elsif Devise::Test.rails6_and_up? ActiveRecord::MigrationContext.new(migrate_path, ActiveRecord::SchemaMigration).migrate elsif Devise::Test.rails52_and_up? ActiveRecord::MigrationContext.new(migrate_path).migrate