diff options
author | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2014-05-08 21:15:58 +0400 |
---|---|---|
committer | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2014-05-31 01:19:50 +0400 |
commit | 2314438925af827b694fbaaf59c31c49dd2c0c31 (patch) | |
tree | d3c49a849926d88ff963a98dcb8a9e6597b85f19 /spec/support/db_cleaner.rb | |
parent | d54d3324b1ae46a60712dbb974214e41fca5b93b (diff) |
Fix for failing specs
Diffstat (limited to 'spec/support/db_cleaner.rb')
-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 |