Skip to content

Commit

Permalink
Use before() & after() instead of around() in DB cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed May 7, 2024
1 parent 415619c commit cf08e5b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions spec/support/database_cleaner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit cf08e5b

Please sign in to comment.