Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-03-10 05:28:20 +0300
committerRémy Coutable <remy@rymai.me>2017-03-22 21:45:21 +0300
commit645a55f19b71bb951f3ce7c3a7915ce878f82e97 (patch)
treedc14ba7bcf596bf8ded773d31d4760acf6602e88 /spec/spec_helper.rb
parent3574963bc01097da418b62ae6f87d02359f36f12 (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.rb1
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