summaryrefslogtreecommitdiff
path: root/spec/javascripts/lib
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-01-27 19:33:58 -0600
committerMike Greiling <mike@pixelcog.com>2017-01-27 19:33:58 -0600
commit69e4072f89ad9aeebcc852373341f790c1b021e2 (patch)
treec68ad1ee38efe48707e8ea467db3e2759f1a88c0 /spec/javascripts/lib
parentc5b7cc54e9bfceda7d48b1f15bcf064a0d96c07d (diff)
parent6ccc4eb42a05d4ce8b75773723305bd82305dfec (diff)
downloadgitlab-ce-69e4072f89ad9aeebcc852373341f790c1b021e2.tar.gz
Merge branch 'master' into go-go-gadget-webpack
* master: (389 commits) Document "No gems fetched from git repositories" policy [ci skip] Typos Small gramatical tweaks Typos Added PHP & NPM doc Use `:empty_project` where possible in request specs Add caching of droplab ajax requests Use `:empty_project` where possible in model specs Revert 3f17f29a Remove unused js response from refs controller Add MR id to changelog entry fixed small mini pipeline graph line glitch Prevent form to be submitted twice Fix Error 500 when repositories contain annotated tags pointing to blobs Fix /explore sorting (trending) Simplify wording in "adding an image" docs Remove "official merge window" from CONTRIBUTING.md [ci skip] Update repository check documentation Fixed flexbox and wrap issues Update two_factor_authentication.md ...
Diffstat (limited to 'spec/javascripts/lib')
-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 9e8456c03aa..fbb06f3948b 100644
--- a/spec/javascripts/lib/utils/common_utils_spec.js.es6
+++ b/spec/javascripts/lib/utils/common_utils_spec.js.es6
@@ -56,5 +56,22 @@ require('~/lib/utils/common_utils');
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');
+ });
+ });
});
})();