diff options
Diffstat (limited to 'test/ng/httpSpec.js')
| -rw-r--r-- | test/ng/httpSpec.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ng/httpSpec.js b/test/ng/httpSpec.js index bb4de3c1..18be5826 100644 --- a/test/ng/httpSpec.js +++ b/test/ng/httpSpec.js @@ -430,6 +430,21 @@ describe('$http', function() { }); + it('should override default headers with custom in a case insensitive manner', function() { + $httpBackend.expect('POST', '/url', 'messageBody', function(headers) { + return headers['accept'] == 'Rewritten' && + headers['content-type'] == 'Content-Type Rewritten' && + headers['Accept'] === undefined && + headers['Content-Type'] === undefined; + }).respond(''); + + $http({url: '/url', method: 'POST', data: 'messageBody', headers: { + 'accept': 'Rewritten', + 'content-type': 'Content-Type Rewritten' + }}); + $httpBackend.flush(); + }); + it('should not send Content-Type header if request data/body is undefined', function() { $httpBackend.expect('POST', '/url', undefined, function(headers) { return !headers.hasOwnProperty('Content-Type'); |
