diff options
| author | Bolek Szewczyk | 2010-09-23 13:48:17 +0200 |
|---|---|---|
| committer | Misko Hevery | 2010-09-23 13:50:10 +0200 |
| commit | 0d5407bc1e976f1f9908d01cfdf848b6c212d135 (patch) | |
| tree | 2ca0a21c22b42a1720808aaf854dbdd833e3a7ef /test/ValidatorsTest.js | |
| parent | db42221828994a6b3056a96924f4a302e72409d4 (diff) | |
| download | angular.js-0d5407bc1e976f1f9908d01cfdf848b6c212d135.tar.bz2 | |
make date validator use the Date object
Diffstat (limited to 'test/ValidatorsTest.js')
| -rw-r--r-- | test/ValidatorsTest.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/ValidatorsTest.js b/test/ValidatorsTest.js index 2e156f84..ca8dad12 100644 --- a/test/ValidatorsTest.js +++ b/test/ValidatorsTest.js @@ -46,8 +46,19 @@ ValidatorTest.prototype.testInteger = function() { ValidatorTest.prototype.testDate = function() { var error = "Value is not a date. (Expecting format: 12/31/2009)."; - assertEquals(angular.validator.date("ab"), error); - assertEquals(angular.validator.date("12/31/2009"), null); + expect(angular.validator.date("ab")).toEqual(error); + expect(angular.validator.date("12/31/2009")).toEqual(null); + expect(angular.validator.date("1/1/1000")).toEqual(null); + expect(angular.validator.date("12/31/9999")).toEqual(null); + expect(angular.validator.date("2/29/2004")).toEqual(null); + expect(angular.validator.date("2/29/2000")).toEqual(null); + expect(angular.validator.date("2/29/2100")).toEqual(error); + expect(angular.validator.date("2/29/2003")).toEqual(error); + expect(angular.validator.date("41/1/2009")).toEqual(error); + expect(angular.validator.date("13/1/2009")).toEqual(error); + expect(angular.validator.date("1/1/209")).toEqual(error); + expect(angular.validator.date("1/32/2010")).toEqual(error); + expect(angular.validator.date("001/031/2009")).toEqual(error); }; ValidatorTest.prototype.testPhone = function() { |
