diff options
| author | Igor Minar | 2010-10-22 11:09:43 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-10-23 14:22:30 -0700 |
| commit | 833e0ae343651a35ccce0940b048e0b5022adc7b (patch) | |
| tree | 9fd2278589b425054cb30d6640c2c56e3417c236 /test/servicesSpec.js | |
| parent | d74ef497defa77c92873b09b7b6f4e19ae175779 (diff) | |
| download | angular.js-833e0ae343651a35ccce0940b048e0b5022adc7b.tar.bz2 | |
$cookieStore should not be a global service
you must use $inject to $inject it as any other non-global service
Diffstat (limited to 'test/servicesSpec.js')
| -rw-r--r-- | test/servicesSpec.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/servicesSpec.js b/test/servicesSpec.js index a27abcc6..276f5de9 100644 --- a/test/servicesSpec.js +++ b/test/servicesSpec.js @@ -541,7 +541,7 @@ describe("service", function(){ describe('$cookieStore', function() { it('should serialize objects to json', function() { - scope.$cookieStore.put('objectCookie', {id: 123, name: 'blah'}); + scope.$inject('$cookieStore').put('objectCookie', {id: 123, name: 'blah'}); scope.$eval(); //force eval in test expect($browser.cookies()).toEqual({'objectCookie': '{"id":123,"name":"blah"}'}); }); @@ -550,12 +550,12 @@ describe("service", function(){ it('should deserialize json to object', function() { $browser.cookies('objectCookie', '{"id":123,"name":"blah"}'); $browser.poll(); - expect(scope.$cookieStore.get('objectCookie')).toEqual({id: 123, name: 'blah'}); + expect(scope.$inject('$cookieStore').get('objectCookie')).toEqual({id: 123, name: 'blah'}); }); it('should delete objects from the store when remove is called', function() { - scope.$cookieStore.put('gonner', { "I'll":"Be Back"}); + scope.$inject('$cookieStore').put('gonner', { "I'll":"Be Back"}); scope.$eval(); //force eval in test expect($browser.cookies()).toEqual({'gonner': '{"I\'ll":"Be Back"}'}); }); |
