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

20 lines
432 B
Ruby
Raw Normal View History

# frozen_string_literal: true
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