mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
fix unittest_validator
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7332 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
df6b14ce57
commit
c2baeee4a3
1 changed files with 11 additions and 11 deletions
|
|
@ -57,17 +57,17 @@ describe('Validator', {
|
|||
value_of(validate()).should_be_true();
|
||||
},
|
||||
'validate with length' : function() {
|
||||
v.cast('ADD_FILTER', ['minlen', {
|
||||
'text' : {required:true, maxlength:5}
|
||||
v.cast('ADD_FILTER', ['minlength', {
|
||||
'text' : {required:true, minlength:5}
|
||||
}]);
|
||||
v.cast('ADD_FILTER', ['maxlen', {
|
||||
v.cast('ADD_FILTER', ['maxlength', {
|
||||
'text' : {required:true, maxlength:10}
|
||||
}]);
|
||||
v.cast('ADD_FILTER', ['minmaxlen', {
|
||||
'text' : {required:true, maxlength:5, maxlength:10,rule:'userid'}
|
||||
v.cast('ADD_FILTER', ['minmaxlength', {
|
||||
'text' : {required:true, minlength:5, maxlength:10}
|
||||
}]);
|
||||
|
||||
set_filter('minlen');
|
||||
set_filter('minlength');
|
||||
|
||||
set_value('1');
|
||||
value_of(validate()).should_be_false();
|
||||
|
|
@ -75,7 +75,7 @@ describe('Validator', {
|
|||
set_value('12345');
|
||||
value_of(validate()).should_be_true();
|
||||
|
||||
set_filter('maxlen');
|
||||
set_filter('maxlength');
|
||||
|
||||
set_value('12345678901');
|
||||
value_of(validate()).should_be_false();
|
||||
|
|
@ -83,18 +83,18 @@ describe('Validator', {
|
|||
set_value('1');
|
||||
value_of(validate()).should_be_true();
|
||||
|
||||
set_filter('minmaxlen');
|
||||
set_filter('minmaxlength');
|
||||
|
||||
set_value('1');
|
||||
value_of(validate()).should_be_false();
|
||||
|
||||
set_value('a12345678901');
|
||||
set_value('12345678901');
|
||||
value_of(validate()).should_be_false();
|
||||
|
||||
set_value('a12345');
|
||||
set_value('12345');
|
||||
value_of(validate()).should_be_true();
|
||||
|
||||
set_value('a1234567');
|
||||
set_value('1234567');
|
||||
value_of(validate()).should_be_true();
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue