gitlab-org--gitlab-foss/spec/support/helpers/inspect_requests.rb
Rémy Coutable 023d4f6f2f
Move spec helpers/matchers/shared examples/contexts to their relevant folder
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-04-23 12:20:30 +02:00

17 lines
401 B
Ruby

require_relative './wait_for_requests'
module InspectRequests
extend self
include WaitForRequests
def inspect_requests(inject_headers: {})
Gitlab::Testing::RequestInspectorMiddleware.log_requests!(inject_headers)
yield
wait_for_all_requests
Gitlab::Testing::RequestInspectorMiddleware.requests
ensure
Gitlab::Testing::RequestInspectorMiddleware.stop_logging!
end
end