diff options
author | Rémy Coutable <remy@rymai.me> | 2017-03-10 05:28:20 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-03-22 21:45:21 +0300 |
commit | 645a55f19b71bb951f3ce7c3a7915ce878f82e97 (patch) | |
tree | dc14ba7bcf596bf8ded773d31d4760acf6602e88 /spec/spec_helper.rb | |
parent | 3574963bc01097da418b62ae6f87d02359f36f12 (diff) |
Introduce a new middleware for the test environment that can block requests
The idea is that after each feature spec example, we block all incoming
requests at the Rack level, go to the 'about:blank' page, and wait until
the current requests reach 0.
This should solve the problem where a request would end after database
cleaner performed the database truncation. The problem was that a GET
request can still lead to records creation (e.g. namespaces or routes).
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ceb3209331f..ad2ecd75d74 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -35,6 +35,7 @@ RSpec.configure do |config| config.include Warden::Test::Helpers, type: :request config.include LoginHelpers, type: :feature config.include SearchHelpers, type: :feature + config.include WaitForRequests, :js config.include WaitForAjax, type: :feature config.include StubConfiguration config.include EmailHelpers, type: :mailer |