Skip to content

Commit 3757780

Browse files
committed
fix testing agains rails >= 7.2
1 parent b033189 commit 3757780

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

.github/workflows/ci.yml

+14
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ jobs:
1313
exclude:
1414
- ruby: ruby-head
1515
rails: "6.1"
16+
- ruby: "2.7"
17+
rails: "7.1"
18+
- ruby: "2.7"
19+
rails: "7.2"
20+
- ruby: "3.0"
21+
rails: "7.1"
22+
- ruby: "3.0"
23+
rails: "7.2"
24+
- ruby: "2.7"
25+
rails: main
26+
- ruby: "3.0"
27+
rails: main
28+
- ruby: "3.1"
29+
rails: main
1630
- ruby: ruby-head
1731
orm: mongoid
1832
- rails: main

test/orm/active_record.rb

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
ActiveRecord::Migration.verbose = false
22
ActiveRecord::Base.logger = Logger.new(nil)
33

4-
if ActiveRecord::VERSION::MAJOR >= 6
5-
ActiveRecord::MigrationContext.new(
6-
File.expand_path('../../rails_app/db/migrate/', __FILE__),
7-
ActiveRecord::Base.connection.schema_migration
8-
).migrate
9-
elsif defined? ActiveRecord::MigrationContext # rails >= 5.2
10-
ActiveRecord::MigrationContext.new(File.expand_path('../../rails_app/db/migrate/', __FILE__)).migrate
11-
else
12-
ActiveRecord::Migrator.migrate(File.expand_path('../../rails_app/db/migrate/', __FILE__))
13-
end
4+
ActiveRecord::MigrationContext.new(
5+
File.expand_path('../../rails_app/db/migrate/', __FILE__)
6+
).migrate

test/test_helper.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
ActionMailer::Base.perform_deliveries = true
1414
ActionMailer::Base.default_url_options[:host] = 'example.com'
1515

16-
ActiveSupport::Deprecation.silenced = true
16+
if ActiveSupport::Deprecation.respond_to?(:silenced=)
17+
ActiveSupport::Deprecation.silenced = true
18+
end
1719
$VERBOSE = false
1820

1921
class ActionDispatch::IntegrationTest

0 commit comments

Comments
 (0)