From 549ff73a9b66e718383c79ccd7c28e4f9b25632d Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 30 Apr 2010 10:27:41 -0700 Subject: clear cache on non-get --- test/servicesSpec.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/servicesSpec.js') diff --git a/test/servicesSpec.js b/test/servicesSpec.js index f15d6ad7..112fc374 100644 --- a/test/servicesSpec.js +++ b/test/servicesSpec.js @@ -207,6 +207,7 @@ describe("service", function(){ describe('cache', function(){ var cache; beforeEach(function(){ cache = scope.$xhr.cache; }); + it('should cache requests', function(){ xhr.expectGET('/url').respond('first'); cache('GET', '/url', null, callback); @@ -236,6 +237,13 @@ describe("service", function(){ xhr.flush(); expect(log).toEqual('"123";"123";'); }); + + it('should clear cache on non GET', function(){ + xhr.expectPOST('abc', {}).respond({}); + cache.data.url = {value:123}; + cache('POST', 'abc', {}); + expect(cache.data.url).toBeUndefined(); + }); }); }); -- cgit v1.2.3