aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorIgor Minar2011-01-20 21:28:27 -0800
committerIgor Minar2011-01-24 14:03:41 -0800
commit94737cd01747e5c7b9b204590f812e4769add0e8 (patch)
treefaa3a19f418694e3453382bb8145d0727c834ec8 /test
parentc8bb044be13f33ef4c661ac9dbf7033b50a45d03 (diff)
downloadangular.js-94737cd01747e5c7b9b204590f812e4769add0e8.tar.bz2
$cookies service should not call $eval during $eval
- added comment - removed $eval call - changed the code to not require $eval - updated specs
Diffstat (limited to 'test')
-rw-r--r--test/servicesSpec.js12
1 files changed, 3 insertions, 9 deletions
diff --git a/test/servicesSpec.js b/test/servicesSpec.js
index eebcf7dc..0569c54a 100644
--- a/test/servicesSpec.js
+++ b/test/servicesSpec.js
@@ -696,20 +696,14 @@ describe("service", function(){
});
- it('should ignore non-string values when asked to create a cookie', function() {
+ it('should drop or reset any cookie that was set to a non-string value', function() {
scope.$cookies.nonString = [1, 2, 3];
- scope.$eval();
- expect($browser.cookies()).toEqual({'preexisting': 'oldCookie'});
- expect(scope.$cookies).toEqual({'preexisting': 'oldCookie'});
- });
-
-
- it('should drop any null or undefined properties', function() {
scope.$cookies.nullVal = null;
scope.$cookies.undefVal = undefined;
+ scope.$cookies.preexisting = function(){};
scope.$eval();
-
expect($browser.cookies()).toEqual({'preexisting': 'oldCookie'});
+ expect(scope.$cookies).toEqual({'preexisting': 'oldCookie'});
});