diff options
| author | jankuca | 2013-08-29 18:52:30 -0700 | 
|---|---|---|
| committer | Igor Minar | 2013-09-02 11:48:14 +0200 | 
| commit | 2a3212a0a333ee4c0640c6b6d63d3c5c34a81c70 (patch) | |
| tree | d906d7a403345011951da2600b68872cc9b5b6ce /test/ng/httpSpec.js | |
| parent | 7a08a76875b5f1f86b129b4f253cd74a75e2658a (diff) | |
| download | angular.js-2a3212a0a333ee4c0640c6b6d63d3c5c34a81c70.tar.bz2 | |
fix($http): allow empty responses to be cached
Closes #3809
Diffstat (limited to 'test/ng/httpSpec.js')
| -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 18be5826..7f49ca8c 100644 --- a/test/ng/httpSpec.js +++ b/test/ng/httpSpec.js @@ -896,6 +896,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'); | 
