diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-06-13 13:51:10 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-06-13 13:51:10 +0300 |
commit | 8e8e7d429e829317f4cd91c3481d160681d062f7 (patch) | |
tree | 0f8e188f22ca4e38920a616c29efff8312c74625 | |
parent | 1b54982fe715fe95530fd54efc85e715a4394ea9 (diff) | |
parent | 899f1d84da9b024a10a0e2d8b6c58e12afa78b7f (diff) |
Merge branch 'fix/gb/fix-migrations-testing-support-hooks-order' into 'master'
Fix migrations testing support RSpec hooks order
Closes #33583
See merge request !12120
-rw-r--r-- | spec/spec_helper.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1979347a178..a81d3573f8d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -106,15 +106,13 @@ RSpec.configure do |config| Sidekiq.redis(&:flushall) end - config.around(:example, :migration) do |example| - begin - ActiveRecord::Migrator - .migrate(migrations_paths, previous_migration.version) - - example.run - ensure - ActiveRecord::Migrator.migrate(migrations_paths) - end + config.before(:example, :migration) do + ActiveRecord::Migrator + .migrate(migrations_paths, previous_migration.version) + end + + config.after(:example, :migration) do + ActiveRecord::Migrator.migrate(migrations_paths) end config.around(:each, :nested_groups) do |example| |