From c63737f75050b1182446f8268c800eb2b2ef4817 Mon Sep 17 00:00:00 2001 From: Jure Grabnar Date: Wed, 31 Jul 2019 14:57:47 +0200 Subject: [PATCH] Add check_pending! call for test migrations Close SCI-3567 --- spec/rails_helper.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index fa9acd82e..43985def7 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -29,9 +29,12 @@ Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } # # Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } -# Checks for pending migration and applies them before tests are run. -# If you are not using ActiveRecord, you can remove this line. -ActiveRecord::Migration.maintain_test_schema! +# Checks for pending migration +begin + ActiveRecord::Migration.check_pending! +rescue ActiveRecord::PendingMigrationError => e + abort(e.message) +end RSpec.configure do |config| # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures