diff options
| author | Igor Minar | 2010-09-22 01:13:51 +0800 |
|---|---|---|
| committer | Misko Hevery | 2010-09-23 17:23:43 +0800 |
| commit | a8931c9021fa15190927b913a66fb34deedf9e20 (patch) | |
| tree | 49b74592a7645b513febab153e8cbc986c7decfd /test | |
| parent | 7cb7fb91c673c006612c38a2ef07d850f642c8df (diff) | |
| download | angular.js-a8931c9021fa15190927b913a66fb34deedf9e20.tar.bz2 | |
Rewrite session store service in object literal style and remove getAll method that is not used anywhere
Diffstat (limited to 'test')
| -rw-r--r-- | test/servicesSpec.js | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/test/servicesSpec.js b/test/servicesSpec.js index 6fa2c5f5..28bde598 100644 --- a/test/servicesSpec.js +++ b/test/servicesSpec.js @@ -429,22 +429,11 @@ describe("service", function(){ it('should serialize objects to json', function() { scope.$sessionStore.put('objectCookie', {id: 123, name: 'blah'}); - scope.$eval(); + scope.$eval(); //force eval in test expect(scope.$browser.cookies()).toEqual({'objectCookie': '{"id":123,"name":"blah"}'}); }); - it('should return all persisted items as a has via getAll', function() { - expect(scope.$sessionStore.getAll()).toEqual({}); - - scope.$sessionStore.put('object1', {id:1,foo:'bar1'}); - scope.$sessionStore.put('object2', {id:2,foo:'bar2'}); - - expect(scope.$sessionStore.getAll()).toEqual({'object1':{id:1,foo:'bar1'}, - 'object2':{id:2,foo:'bar2'}}); - }); - - it('should deserialize json to object', function() { scope.$browser.cookies('objectCookie', '{"id":123,"name":"blah"}'); scope.$browser.poll(); @@ -454,8 +443,7 @@ describe("service", function(){ it('should delete objects from the store when remove is called', function() { scope.$sessionStore.put('gonner', { "I'll":"Be Back"}); - // TODO: Is this $eval necessary (why was it not here before?) - scope.$eval(); + scope.$eval(); //force eval in test expect(scope.$browser.cookies()).toEqual({'gonner': '{"I\'ll":"Be Back"}'}); }); |
