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>
Showing
... | @@ -327,6 +327,7 @@ group :test do | ... | @@ -327,6 +327,7 @@ group :test do |
gem 'test_after_commit', '~> 1.1' | gem 'test_after_commit', '~> 1.1' | ||
gem 'sham_rack', '~> 1.3.6' | gem 'sham_rack', '~> 1.3.6' | ||
gem 'timecop', '~> 0.8.0' | gem 'timecop', '~> 0.8.0' | ||
gem 'concurrent-ruby', '~> 1.0.5' | |||
end | end | ||
gem 'octokit', '~> 4.6.2' | gem 'octokit', '~> 4.6.2' | ||
... | ... |
spec/support/wait_for_requests.rb
0 → 100644
Please
register
or
sign in
to comment