Skip to content

Commit

Permalink
Add more tests for min validators. Part of thedersen#341
Browse files Browse the repository at this point in the history
  • Loading branch information
Luiz Américo committed Apr 21, 2018
1 parent 65398a6 commit 2127c9e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/validators/min.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}));
}
}

}
}

0 comments on commit 2127c9e

Please sign in to comment.