From 25567d6bd6b4bf9fcea7e644fd6a8323fdbfea26 Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Wed, 5 Dec 2018 09:49:37 +0100 Subject: [PATCH] Do not clean DB twice on feature specs It turns out that we were executing `DatabaseCleaner.clean` on two `after(:each)` blocks. One for all specs and another one for `js: true` specs. As a result feature specs were hitting both which slows them down considerably. On my machine this changes consistently saves 2sec on `spec/features/consumer/shops_spec.rb` but chances are it has an accumulative effect when run on the whole test suite. --- spec/spec_helper.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6b73d23fb0..c198a68fbb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -91,7 +91,6 @@ RSpec.configure do |config| config.after(:each, js:true) do Capybara.reset_sessions! RackRequestBlocker.wait_for_requests_complete - DatabaseCleaner.clean end def restart_phantomjs