diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-06-13 10:18:43 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-06-13 10:18:43 +0200 |
commit | 899f1d84da9b024a10a0e2d8b6c58e12afa78b7f (patch) | |
tree | 2342eb966299b0457b7741079091d005b3c18c2f /spec/spec_helper.rb | |
parent | 6f5a68f528d6c11f3bfd013e30cc71845abe6ef8 (diff) | |
download | gitlab-ce-899f1d84da9b024a10a0e2d8b6c58e12afa78b7f.tar.gz |
Fix migrations testing support RSpec hooks orderfix/gb/fix-migrations-testing-support-hooks-order
Diffstat (limited to 'spec/spec_helper.rb')
-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| |