Skip to content

A platform for community discussion. Free, open, simple.

FIX: Set test transaction to before_all transaction (#22445)

Daniel Waterworth5e2edeb2f751
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index 12c952109a1..e498a3fd45f 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -149,7 +149,12 @@ module TestSetup
end
end
-TestProf::BeforeAll.configure { |config| config.before(:begin) { TestSetup.test_setup } }
+TestProf::BeforeAll.configure do |config|
+ config.after(:begin) do
+ TestSetup.test_setup
+ DB.test_transaction = ActiveRecord::Base.connection.current_transaction
+ end
+end
if ENV["PREFABRICATION"] == "0"
module Prefabrication