Running Rspec is apparently not always enough to determine that there are no pending migrations, but we want to ensure that database dumps that are committed are up-to-date.
Not sure this needs to be in Rspec tests, but can force a check before an Rspec suite by
adding to spec/rails_helper.rb,
config.before(:suite) do
expect { ActiveRecord::Migration.check_pending! }.not_to raise_error(ActiveRecord::PendingMigrationError)
end
Running Rspec is apparently not always enough to determine that there are no pending migrations, but we want to ensure that database dumps that are committed are up-to-date.
Not sure this needs to be in Rspec tests, but can force a check before an Rspec suite by adding to spec/rails_helper.rb,