Skip to content

Commit

Permalink
Use around each in database cleaner config
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Aug 13, 2024
1 parent 3b5cc1c commit 2557aed
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions spec/support/database_cleaner.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# See the docs here: https://www.rubydoc.info/github/DatabaseCleaner/database_cleaner
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end

config.before(:each) do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.start
DatabaseCleaner.clean_with(:truncation)
end

config.append_after(:each) do
DatabaseCleaner.clean
config.around(:each) do |example|
DatabaseCleaner.cleaning do
example.run
end
end
end

0 comments on commit 2557aed

Please sign in to comment.