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.
This commit is contained in:
Pau Perez
2018-12-05 09:49:37 +01:00
parent 3b56212290
commit 25567d6bd6

View File

@@ -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