summaryrefslogtreecommitdiff
path: root/spec/support/helpers/inspect_requests.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/helpers/inspect_requests.rb')
-rw-r--r--spec/support/helpers/inspect_requests.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/support/helpers/inspect_requests.rb b/spec/support/helpers/inspect_requests.rb
new file mode 100644
index 00000000000..88ddc5c7f6c
--- /dev/null
+++ b/spec/support/helpers/inspect_requests.rb
@@ -0,0 +1,17 @@
+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