diff options
| author | Misko Hevery | 2011-02-03 15:21:34 -0800 |
|---|---|---|
| committer | Misko Hevery | 2011-02-03 20:03:38 -0800 |
| commit | 882f412d578e4f01394847fa5fde21b6b4096de2 (patch) | |
| tree | 2d62877e0c00a5117ae3988172e630b1af9c10e5 /docs/cookbook.form.ngdoc | |
| parent | 0d4def68ae0d95dd106d2731d60b6d6b635b5afc (diff) | |
| download | angular.js-882f412d578e4f01394847fa5fde21b6b4096de2.tar.bz2 | |
Added remainder of the cookbook
Diffstat (limited to 'docs/cookbook.form.ngdoc')
| -rw-r--r-- | docs/cookbook.form.ngdoc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/docs/cookbook.form.ngdoc b/docs/cookbook.form.ngdoc index 4b9709cd..7d55f0a4 100644 --- a/docs/cookbook.form.ngdoc +++ b/docs/cookbook.form.ngdoc @@ -66,18 +66,24 @@ allow a user to enter data. expect(binding('user')).not().toMatch(/\(234\) 555\-1212/); }); - iit('should validate zip', function(){ - var form = using('.example'); - expect(form.element(':input[name=user.address.zip]').attr('className')) + it('should validate zip', function(){ + expect(using('.example').element(':input[name=user.address.zip]').attr('className')) .not().toMatch(/ng-validation-error/) - form.input('user.address.zip').enter('abc'); + using('.example').input('user.address.zip').enter('abc'); - expect(form.element(':input[name=user.address.zip]').attr('className')) + expect(using('.example').element(':input[name=user.address.zip]').attr('className')) .toMatch(/ng-validation-error/) }); - iit('should validate state', function(){ + it('should validate state', function(){ + expect(using('.example').element(':input[name=user.address.state]').attr('className')) + .not().toMatch(/ng-validation-error/) + + using('.example').input('user.address.state').enter('XXX'); + + expect(using('.example').element(':input[name=user.address.state]').attr('className')) + .toMatch(/ng-validation-error/) }); </doc:scenario> </doc:example> |
