diff options
Diffstat (limited to 'spec')
-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| |