diff --git a/test/validators/min.js b/test/validators/min.js index 8be813ce..0d63380e 100644 --- a/test/validators/min.js +++ b/test/validators/min.js @@ -107,6 +107,30 @@ module.exports = { age: null }, { validate: true })); } + }, + + "when min:0, 0 < val < 1": { + setUp: function() { + this.model.validation.aFloat = { + min: 0 + }; + }, + "val is string, no leading zero, e.g. '.2'": function() { + assert(this.model.set({ + aFloat: '.2' + }, {validate: true})); + }, + "val is string, leading zero, e.g. '0.2'": function() { + assert(this.model.set({ + aFloat: '0.2' + }, {validate: true})); + }, + "val is number, leading zero, e.g. 0.2": function() { + assert(this.model.set({ + aFloat: 0.2 + }, {validate: true})); + } } + } } \ No newline at end of file