blob: 6f385d6e019534fd0fd64dcd52b0216d55ce3715 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# frozen_string_literal: true
require_relative 'db_cleaner'
RSpec.configure do |config|
include DbCleaner
# Ensure all sequences are reset at the start of the suite run
config.before(:suite) do
setup_database_cleaner
DatabaseCleaner.clean_with(:truncation)
end
config.append_after(:context) do
delete_from_all_tables!
end
config.around(:each, :delete) do |example|
self.class.use_transactional_tests = false
example.run
delete_from_all_tables!(except: deletion_except_tables)
end
config.around(:each, :migration) do |example|
self.class.use_transactional_tests = false
example.run
delete_from_all_tables!
end
end
|