Skip to content

Commit

Permalink
fix testing agains rails >= 7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
scambra committed Oct 16, 2024
1 parent b033189 commit 3757780
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 3 additions & 10 deletions test/orm/active_record.rb
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3757780

Please sign in to comment.