From cf08e5b4b126e0410bfb754e803e77c5f5c09233 Mon Sep 17 00:00:00 2001 From: Splines Date: Tue, 7 May 2024 10:51:34 +0200 Subject: [PATCH] Use before() & after() instead of around() in DB cleaner --- spec/support/database_cleaner.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/spec/support/database_cleaner.rb b/spec/support/database_cleaner.rb index 9e357afce..90704d2a3 100644 --- a/spec/support/database_cleaner.rb +++ b/spec/support/database_cleaner.rb @@ -2,12 +2,14 @@ RSpec.configure do |config| config.before(:suite) do DatabaseCleaner.strategy = :transaction - DatabaseCleaner.clean_with(:truncation, except: ["ar_internal_metadata"]) + DatabaseCleaner.clean_with(:truncation) end - config.around(:each) do |example| - DatabaseCleaner.cleaning do - example.run - end + config.before(:each) do + DatabaseCleaner.start + end + + config.after(:each) do + DatabaseCleaner.clean end end