summaryrefslogtreecommitdiff
path: root/spec/support/workhorse_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/workhorse_helpers.rb')
-rw-r--r--spec/support/workhorse_helpers.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/support/workhorse_helpers.rb b/spec/support/workhorse_helpers.rb
new file mode 100644
index 00000000000..107b6e30924
--- /dev/null
+++ b/spec/support/workhorse_helpers.rb
@@ -0,0 +1,16 @@
+module WorkhorseHelpers
+ extend self
+
+ def workhorse_send_data
+ @_workhorse_send_data ||= begin
+ header = response.headers[Gitlab::Workhorse::SEND_DATA_HEADER]
+ split_header = header.split(':')
+ type = split_header.shift
+ header = split_header.join(':')
+ [
+ type,
+ JSON.parse(Base64.urlsafe_decode64(header)),
+ ]
+ end
+ end
+end