Commit 555d3226 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Restore use_transactional_tests value after delete

This is needed for specs that have the :delete metadata on a specific
example and not on the whole file / class.

Without this, succeeding tests in the same file would run without any
transaction wrapper and without any DB cleanup.
parent c8fa2f9a
......@@ -52,6 +52,8 @@ RSpec.configure do |config|
example.run
delete_from_all_tables!(except: deletion_except_tables)
self.class.use_transactional_tests = true
end
config.around(:each, :migration) do |example|
......@@ -60,5 +62,7 @@ RSpec.configure do |config|
example.run
delete_from_all_tables!
self.class.use_transactional_tests = true
end
end
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