summaryrefslogtreecommitdiff
path: root/spec/javascripts/lib/utils
diff options
context:
space:
mode:
authorRegis <boudinot.regis@yahoo.com>2017-01-24 09:56:26 -0700
committerRegis <boudinot.regis@yahoo.com>2017-01-24 09:56:26 -0700
commit14b1d69b150f4e241fb6a47009e2b00c9520a199 (patch)
treedb7b4638b2b17dd619ece6f1dc536f783364ce3f /spec/javascripts/lib/utils
parent30d5e9fa54e0beacfb9b28c307543ff359f17668 (diff)
downloadgitlab-ce-14b1d69b150f4e241fb6a47009e2b00c9520a199.tar.gz
use gl.utils.normalizeHeaders in pipelines storenormalize_frontend_headers
Diffstat (limited to 'spec/javascripts/lib/utils')
-rw-r--r--spec/javascripts/lib/utils/common_utils_spec.js.es617
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/javascripts/lib/utils/common_utils_spec.js.es6 b/spec/javascripts/lib/utils/common_utils_spec.js.es6
index 031f9ca03c9..1ce8f28e568 100644
--- a/spec/javascripts/lib/utils/common_utils_spec.js.es6
+++ b/spec/javascripts/lib/utils/common_utils_spec.js.es6
@@ -52,5 +52,22 @@
expect(value).toBe(null);
});
});
+
+ describe('gl.utils.normalizedHeaders', () => {
+ it('should upperCase all the header keys to keep them consistent', () => {
+ const apiHeaders = {
+ 'X-Something-Workhorse': { workhorse: 'ok' },
+ 'x-something-nginx': { nginx: 'ok' },
+ };
+
+ const normalized = gl.utils.normalizeHeaders(apiHeaders);
+
+ const WORKHORSE = 'X-SOMETHING-WORKHORSE';
+ const NGINX = 'X-SOMETHING-NGINX';
+
+ expect(normalized[WORKHORSE].workhorse).toBe('ok');
+ expect(normalized[NGINX].nginx).toBe('ok');
+ });
+ });
});
})();