summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Edwards-Jones <jedwardsjones@gitlab.com>2017-04-11 15:00:45 +0100
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2017-12-21 16:29:44 +0000
commit8ae423f7891ec3112276f253d97ed68c55234a28 (patch)
tree050741e6d6af9cb05135c949294a5df633abdd39
parent130b03c264b7a11a035a8dc2acd3c66279455704 (diff)
downloadgitlab-ce-30783-database-cleaner-deletion.tar.gz
Prefer DatabaseCleaner deletion over truncation in tests for performance30783-database-cleaner-deletion
-rw-r--r--features/support/db_cleaner.rb2
-rw-r--r--spec/support/db_cleaner.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/features/support/db_cleaner.rb b/features/support/db_cleaner.rb
index 8294bb1445f..31c922d23c3 100644
--- a/features/support/db_cleaner.rb
+++ b/features/support/db_cleaner.rb
@@ -1,6 +1,6 @@
require 'database_cleaner'
-DatabaseCleaner[:active_record].strategy = :truncation
+DatabaseCleaner[:active_record].strategy = :deletion
Spinach.hooks.before_scenario do
DatabaseCleaner.start
diff --git a/spec/support/db_cleaner.rb b/spec/support/db_cleaner.rb
index edaee03ea6c..7991974499d 100644
--- a/spec/support/db_cleaner.rb
+++ b/spec/support/db_cleaner.rb
@@ -1,10 +1,10 @@
RSpec.configure do |config|
config.before(:suite) do
- DatabaseCleaner.clean_with(:truncation)
+ DatabaseCleaner.clean_with(:deletion)
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,7 +12,7 @@ RSpec.configure do |config|
end
config.before(:each, :js) do
- DatabaseCleaner.strategy = :truncation
+ DatabaseCleaner.strategy = :deletion
end
config.before(:each, :truncate) do