diff options
author | Nick Thomas <nick@gitlab.com> | 2018-01-17 11:30:25 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-01-24 17:25:55 +0000 |
commit | 93ea3234dfaa43204c5f24d4010bbe5070d75c72 (patch) | |
tree | dab7e978b28b6dc79349a3e084fad36175cf55d7 /spec/support/db_cleaner.rb | |
parent | 5a4fb8f0d183c7dd1560c90e750a7a37141c22d4 (diff) | |
download | gitlab-ce-93ea3234dfaa43204c5f24d4010bbe5070d75c72.tar.gz |
Use the DatabaseCleaner 'deletion' strategy instead of 'truncation'
Diffstat (limited to 'spec/support/db_cleaner.rb')
-rw-r--r-- | spec/support/db_cleaner.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/spec/support/db_cleaner.rb b/spec/support/db_cleaner.rb index edaee03ea6c..7ca88cc61d3 100644 --- a/spec/support/db_cleaner.rb +++ b/spec/support/db_cleaner.rb @@ -1,10 +1,11 @@ RSpec.configure do |config| + # Ensure all sequences are reset at the start of the suite run config.before(:suite) do DatabaseCleaner.clean_with(:truncation) end config.append_after(:context) do - DatabaseCleaner.clean_with(:truncation, cache_tables: false) + DatabaseCleaner.clean_with(:deletion, cache_tables: false) end config.before(:each) do @@ -12,15 +13,15 @@ RSpec.configure do |config| end config.before(:each, :js) do - DatabaseCleaner.strategy = :truncation + DatabaseCleaner.strategy = :deletion end - config.before(:each, :truncate) do - DatabaseCleaner.strategy = :truncation + config.before(:each, :delete) do + DatabaseCleaner.strategy = :deletion end config.before(:each, :migration) do - DatabaseCleaner.strategy = :truncation, { cache_tables: false } + DatabaseCleaner.strategy = :deletion, { cache_tables: false } end config.before(:each) do |