From 37577806858defc640ab7956aec40ee9107215b0 Mon Sep 17 00:00:00 2001 From: Sergio Cambra Date: Wed, 16 Oct 2024 16:50:47 +0200 Subject: [PATCH] fix testing agains rails >= 7.2 --- .github/workflows/ci.yml | 14 ++++++++++++++ test/orm/active_record.rb | 13 +++---------- test/test_helper.rb | 4 +++- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62562560..eed072a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,20 @@ jobs: exclude: - ruby: ruby-head rails: "6.1" + - ruby: "2.7" + rails: "7.1" + - ruby: "2.7" + rails: "7.2" + - ruby: "3.0" + rails: "7.1" + - ruby: "3.0" + rails: "7.2" + - ruby: "2.7" + rails: main + - ruby: "3.0" + rails: main + - ruby: "3.1" + rails: main - ruby: ruby-head orm: mongoid - rails: main diff --git a/test/orm/active_record.rb b/test/orm/active_record.rb index 1c5fd8bd..b69705c0 100644 --- a/test/orm/active_record.rb +++ b/test/orm/active_record.rb @@ -1,13 +1,6 @@ ActiveRecord::Migration.verbose = false ActiveRecord::Base.logger = Logger.new(nil) -if ActiveRecord::VERSION::MAJOR >= 6 - ActiveRecord::MigrationContext.new( - File.expand_path('../../rails_app/db/migrate/', __FILE__), - ActiveRecord::Base.connection.schema_migration - ).migrate -elsif defined? ActiveRecord::MigrationContext # rails >= 5.2 - ActiveRecord::MigrationContext.new(File.expand_path('../../rails_app/db/migrate/', __FILE__)).migrate -else - ActiveRecord::Migrator.migrate(File.expand_path('../../rails_app/db/migrate/', __FILE__)) -end +ActiveRecord::MigrationContext.new( + File.expand_path('../../rails_app/db/migrate/', __FILE__) +).migrate \ No newline at end of file diff --git a/test/test_helper.rb b/test/test_helper.rb index a4e65464..add2d98c 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -13,7 +13,9 @@ ActionMailer::Base.perform_deliveries = true ActionMailer::Base.default_url_options[:host] = 'example.com' -ActiveSupport::Deprecation.silenced = true +if ActiveSupport::Deprecation.respond_to?(:silenced=) + ActiveSupport::Deprecation.silenced = true +end $VERBOSE = false class ActionDispatch::IntegrationTest