diff options
| author | Misko Hevery | 2010-04-07 14:15:09 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-04-07 14:15:09 -0700 |
| commit | 3d0b40fee2feeb49f46063b2012977c623f1ef6f (patch) | |
| tree | 5a95589e6985fddd6111636da46a835cef94bcb4 /test | |
| parent | ab7b7dbf76d25401c4862171b3e54c9748b5098c (diff) | |
| parent | 3c5e0205f947fb1aef0eb1261f7d980600ab5482 (diff) | |
| download | angular.js-3d0b40fee2feeb49f46063b2012977c623f1ef6f.tar.bz2 | |
Merge branch 'directives' of github.com:angular/angular.js into directives
Diffstat (limited to 'test')
| -rw-r--r-- | test/servicesSpec.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/servicesSpec.js b/test/servicesSpec.js index 43511853..b7dfe4c8 100644 --- a/test/servicesSpec.js +++ b/test/servicesSpec.js @@ -54,3 +54,23 @@ describe("services", function(){ }); }); + +describe("service $invalidWidgets", function(){ + var scope; + beforeEach(function(){ + scope = null; + }); + afterEach(function(){ + if (scope && scope.$element) + scope.$element.remove(); + }); + + it("should count number of invalid widgets", function(){ + var scope = compile('<input name="price" ng-required></input>').$init(); + expect(scope.$invalidWidgets.length).toEqual(1); + scope.price = 123; + scope.$eval(); + expect(scope.$invalidWidgets.length).toEqual(0); + scope.$element.remove(); + }); +}); |
