From 094b23ccd0f9c511aa468e20fb117be20dd01985 Mon Sep 17 00:00:00 2001 From: Espen Antonsen Date: Tue, 23 Jun 2020 11:23:10 +0200 Subject: [PATCH] tests can run on Rails 6 --- test/dummy/app/assets/config/manifest.js | 0 test/test_helper.rb | 8 +++++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 test/dummy/app/assets/config/manifest.js diff --git a/test/dummy/app/assets/config/manifest.js b/test/dummy/app/assets/config/manifest.js new file mode 100644 index 0000000..e69de29 diff --git a/test/test_helper.rb b/test/test_helper.rb index 9109d4b..ead3611 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -7,6 +7,12 @@ # Run migrations for in-memory SQLite database ActiveRecord::Migration.verbose = false -ActiveRecord::Migrator.migrate(File.expand_path('../dummy/db/migrate/', __FILE__)) +if ActiveRecord.version.release() < Gem::Version.new('5.2.0') + ActiveRecord::Migrator.migrate(File.expand_path('../dummy/db/migrate/', __FILE__)) +elsif ActiveRecord.version.release() < Gem::Version.new('6.0.0') + ActiveRecord::MigrationContext.new(File.expand_path('../dummy/db/migrate/', __FILE__)).migrate +else + ActiveRecord::MigrationContext.new(File.expand_path('../dummy/db/migrate/', __FILE__), ActiveRecord::SchemaMigration).migrate +end Rails.backtrace_cleaner.remove_silencers!