Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-06 10:01:17 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-06 10:01:17 +0400
commit67ba36ebaca1a6346d443952ec06ac089a217de7 (patch)
tree18e99cfb792e8168a524c3f53d458a749c724847 /spec
parent440036df69d147fcd4df10a85731199e6aa1d84b (diff)
Revert "Revert "Fix for failing specs""
This reverts commit 2545b0f85851d1e4ebc1137a2c8786a238e02ee4.
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