gitlab-org--gitlab-foss/spec/support/db_cleaner.rb
Rémy Coutable bce00bad77 Truncate the DB in after(:all) test for Gitlab::ImportExport::ProjectTreeRestorer
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-02-17 18:58:11 +01:00

29 lines
574 B
Ruby

RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.append_after(:context) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, js: true) do
DatabaseCleaner.strategy = :truncation
end
config.before(:each, truncate: true) do
DatabaseCleaner.strategy = :truncation
end
config.before(:each) do
DatabaseCleaner.start
end
config.append_after(:each) do
DatabaseCleaner.clean
end
end