diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/directivesSpec.js | 12 |
1 files changed, 12 insertions, 0 deletions
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('<div ng-watch="i: count = count + 1" ng-init="count = 0">'); + scope.updateView(); + scope.updateView(); + expect(scope.get('count')).toEqual(0); + + scope.set('i', 0); + scope.updateView(); + scope.updateView(); + expect(scope.get('count')).toEqual(1); + }); }); |
