diff options
Diffstat (limited to 'test/ng')
| -rw-r--r-- | test/ng/httpSpec.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ng/httpSpec.js b/test/ng/httpSpec.js index ec1cb7f1..d3653a67 100644 --- a/test/ng/httpSpec.js +++ b/test/ng/httpSpec.js @@ -1248,6 +1248,20 @@ describe('$http', function() { }); + it('should allow the cached value to be an empty string', function () { + cache.put('/abc', ''); + + callback.andCallFake(function (response, status, headers) { + expect(response).toBe(''); + expect(status).toBe(200); + }); + + $http({method: 'GET', url: '/abc', cache: cache}).success(callback); + $rootScope.$digest(); + expect(callback).toHaveBeenCalled(); + }); + + it('should default to status code 200 and empty headers if cache contains a non-array element', inject(function($rootScope) { cache.put('/myurl', 'simple response'); |
