From 94737cd01747e5c7b9b204590f812e4769add0e8 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 20 Jan 2011 21:28:27 -0800 Subject: $cookies service should not call $eval during $eval - added comment - removed $eval call - changed the code to not require $eval - updated specs --- test/servicesSpec.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'test') 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'}); }); -- cgit v1.2.3