Commit 899f1d84 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Fix migrations testing support RSpec hooks order

parent 6f5a68f5
......@@ -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|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment