diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-06-03 09:13:33 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-06-03 09:13:33 +0300 |
commit | a54bef0a4200d8323bb18e8d11481ef7bd63d314 (patch) | |
tree | b0cc49126d6de01bbcecde47886b81ffb59cb123 /spec | |
parent | fc72f8e37ccb447131ee1492c147cef9add83581 (diff) | |
parent | 3351f15af63929caec03c8dd0d62f52b8f7704eb (diff) | |
download | gitlab-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.rb | 31 |
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 |