Migrate down before each migration unit test

`migrate!` helper triggers a migration that is under the test, so we
need to revert it before each subsequent example. This means that we
need to place it in `before(:each, :migration)` hook.

We still want to migrate everything up *after* each *context*, so in
otherwords we need to place migrate up helper in `before(:context,
:migration)`.
This commit is contained in:
Grzegorz Bizon 2017-08-17 11:42:17 +02:00
parent d90b0f8c99
commit 56d24bcf80

View file

@ -132,7 +132,7 @@ RSpec.configure do |config|
Sidekiq.redis(&:flushall) Sidekiq.redis(&:flushall)
end end
config.before(:context, :migration) do config.before(:each, :migration) do
schema_migrate_down! schema_migrate_down!
end end