summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/support/db_cleaner.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/support/db_cleaner.rb b/spec/support/db_cleaner.rb
index ac38e31b77e..33fa2e3fd6f 100644
--- a/spec/support/db_cleaner.rb
+++ b/spec/support/db_cleaner.rb
@@ -1,21 +1,21 @@
RSpec.configure do |config|
config.before(:suite) do
- DatabaseCleaner.clean_with(:truncation)
- end
-
- config.before(:each) do
DatabaseCleaner.strategy = :transaction
+ DatabaseRewinder.clean_all
end
- config.before(:each, js: true) do
- DatabaseCleaner.strategy = :truncation
- end
-
- config.before(:each) do
- DatabaseCleaner.start
+ config.before(:each) do |example|
+ unless example.metadata[:js]
+ DatabaseCleaner.start
+ end
end
- config.append_after(:each) do
- DatabaseCleaner.clean
+ config.append_after(:each) do |example|
+ if example.metadata[:js]
+ DatabaseRewinder.clean
+ else
+ DatabaseCleaner.clean
+ DatabaseRewinder.cleaners.each {|c| c.send(:reset) }
+ end
end
end