summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-03 09:13:33 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-03 09:13:33 +0300
commita54bef0a4200d8323bb18e8d11481ef7bd63d314 (patch)
treeb0cc49126d6de01bbcecde47886b81ffb59cb123 /spec
parentfc72f8e37ccb447131ee1492c147cef9add83581 (diff)
parent3351f15af63929caec03c8dd0d62f52b8f7704eb (diff)
downloadgitlab-ce-a54bef0a4200d8323bb18e8d11481ef7bd63d314.tar.gz
Merge pull request #6943 from jvanbaarsen/spec-fix
Fix for failing specs
Diffstat (limited to 'spec')
-rw-r--r--spec/support/db_cleaner.rb31
1 files changed, 15 insertions, 16 deletions
diff --git a/spec/support/db_cleaner.rb b/spec/support/db_cleaner.rb
index 8c9c74f14bd..f2b310245bd 100644
--- a/spec/support/db_cleaner.rb
+++ b/spec/support/db_cleaner.rb
@@ -1,22 +1,21 @@
-require 'database_cleaner'
-
RSpec.configure do |config|
- config.before do
- if example.metadata[:js]
- DatabaseCleaner.strategy = :truncation
- Capybara::Selenium::Driver::DEFAULT_OPTIONS[:resynchronize] = true
- else
- DatabaseCleaner.strategy = :transaction
- end
+ config.around(:each) do
+ DatabaseCleaner.clean_with(:truncation)
+ end
+
+ config.around(:each) do
+ DatabaseCleaner.strategy = :transaction
+ end
+
+ config.around(:each, js: true) do
+ DatabaseCleaner.strategy = :truncation
+ end
- unless example.metadata[:no_db]
- DatabaseCleaner.start
- end
+ config.before(:each) do
+ DatabaseCleaner.start
end
- config.after do
- unless example.metadata[:no_db]
- DatabaseCleaner.clean
- end
+ config.after(:each) do
+ DatabaseCleaner.clean
end
end