2019-07-25 01:27:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-10-23 08:57:06 -04:00
|
|
|
require_relative './wait_for_requests'
|
|
|
|
|
|
|
|
module InspectRequests
|
|
|
|
extend self
|
|
|
|
include WaitForRequests
|
|
|
|
|
2017-10-30 16:06:08 -04:00
|
|
|
def inspect_requests(inject_headers: {})
|
|
|
|
Gitlab::Testing::RequestInspectorMiddleware.log_requests!(inject_headers)
|
2017-11-01 17:15:16 -04:00
|
|
|
|
2017-10-23 08:57:06 -04:00
|
|
|
yield
|
2017-11-01 17:15:16 -04:00
|
|
|
|
2017-11-02 16:34:30 -04:00
|
|
|
wait_for_all_requests
|
2017-10-23 08:57:06 -04:00
|
|
|
Gitlab::Testing::RequestInspectorMiddleware.requests
|
|
|
|
ensure
|
|
|
|
Gitlab::Testing::RequestInspectorMiddleware.stop_logging!
|
|
|
|
end
|
|
|
|
end
|