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>
显示
- Gemfile 1 个添加, 0 个删除Gemfile
- Gemfile.lock 2 个添加, 1 个删除Gemfile.lock
- config/environments/test.rb 3 个添加, 0 个删除config/environments/test.rb
- lib/gitlab/testing/request_blocker_middleware.rb 61 个添加, 0 个删除lib/gitlab/testing/request_blocker_middleware.rb
- spec/spec_helper.rb 1 个添加, 0 个删除spec/spec_helper.rb
- spec/support/wait_for_requests.rb 40 个添加, 0 个删除spec/support/wait_for_requests.rb
加载中
想要评论请 注册 或 登录