diff options
author | Regis <boudinot.regis@yahoo.com> | 2017-01-24 09:56:26 -0700 |
---|---|---|
committer | Regis <boudinot.regis@yahoo.com> | 2017-01-24 09:56:26 -0700 |
commit | 14b1d69b150f4e241fb6a47009e2b00c9520a199 (patch) | |
tree | db7b4638b2b17dd619ece6f1dc536f783364ce3f /spec/javascripts | |
parent | 30d5e9fa54e0beacfb9b28c307543ff359f17668 (diff) | |
download | gitlab-ce-14b1d69b150f4e241fb6a47009e2b00c9520a199.tar.gz |
use gl.utils.normalizeHeaders in pipelines storenormalize_frontend_headers
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/lib/utils/common_utils_spec.js.es6 | 17 |
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'); + }); + }); }); })(); |