gitlab-org--gitlab-foss/spec/support/helpers/inspect_requests.rb

18 lines
401 B
Ruby
Raw Normal View History

2017-10-23 08:57:06 -04:00
require_relative './wait_for_requests'
module InspectRequests
extend self
include WaitForRequests
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
wait_for_all_requests
2017-10-23 08:57:06 -04:00
Gitlab::Testing::RequestInspectorMiddleware.requests
ensure
Gitlab::Testing::RequestInspectorMiddleware.stop_logging!
end
end