aquariumbio / aquarium

The Aquarium Lab Operating System
http://klavinslab.org/aquaverse/
MIT License
58 stars 15 forks source link

v3-testing: confirm migrations have been applied to default database #485

Open bjkeller opened 3 years ago

bjkeller commented 3 years ago

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