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