aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBolek Szewczyk2010-09-23 13:48:17 +0200
committerMisko Hevery2010-09-23 13:50:10 +0200
commit0d5407bc1e976f1f9908d01cfdf848b6c212d135 (patch)
tree2ca0a21c22b42a1720808aaf854dbdd833e3a7ef /test
parentdb42221828994a6b3056a96924f4a302e72409d4 (diff)
downloadangular.js-0d5407bc1e976f1f9908d01cfdf848b6c212d135.tar.bz2
make date validator use the Date object
Diffstat (limited to 'test')
-rw-r--r--test/ValidatorsTest.js15
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() {