From 6f8276a8e3735396999bd158005ca86bb1bb0978 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Mon, 22 Mar 2010 16:07:42 -0700 Subject: ng-watch directive --- test/directivesSpec.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/directivesSpec.js') diff --git a/test/directivesSpec.js b/test/directivesSpec.js index 2cee20d1..e0e53eeb 100644 --- a/test/directivesSpec.js +++ b/test/directivesSpec.js @@ -82,4 +82,16 @@ describe("directives", function(){ }); expect(log).toEqual("\"Expected ng-repeat in form of 'item in collection' but got 'i dont parse'.\";true;"); }); + + it('should ng-watch', function(){ + var scope = compile('
'); + scope.updateView(); + scope.updateView(); + expect(scope.get('count')).toEqual(0); + + scope.set('i', 0); + scope.updateView(); + scope.updateView(); + expect(scope.get('count')).toEqual(1); + }); }); -- cgit v1.2.3