better integer farmater

This commit is contained in:
Misko Hevery
2010-02-05 14:41:45 -08:00
parent 6d75afe6d2
commit 9d566a0cd0
5 changed files with 34 additions and 8 deletions

View File

@@ -19,6 +19,8 @@ ValidatorTest.prototype.testNumber = function() {
ValidatorTest.prototype.testInteger = function() {
assertEquals(angular.validator.integer("ab"), "Value is not a number.");
assertEquals(angular.validator.integer("1.1"), "Value is not a whole number.");
assertEquals(angular.validator.integer("1.0"), "Value is not a whole number.");
assertEquals(angular.validator.integer("1."), "Value is not a whole number.");
assertEquals(angular.validator.integer("-1",0), "Value can not be less than 0.");
assertEquals(angular.validator.integer("11",0,10), "Value can not be greater than 10.");
assertEquals(angular.validator.integer("1"), null);