diff options
author | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2014-05-08 19:15:58 +0200 |
---|---|---|
committer | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2014-05-30 23:19:50 +0200 |
commit | 2314438925af827b694fbaaf59c31c49dd2c0c31 (patch) | |
tree | d3c49a849926d88ff963a98dcb8a9e6597b85f19 /spec | |
parent | d54d3324b1ae46a60712dbb974214e41fca5b93b (diff) | |
download | gitlab-ce-2314438925af827b694fbaaf59c31c49dd2c0c31.tar.gz |
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 |