@@ -171,7 +171,11 @@ describe('validation library', function() {
171171 it ( 'does not match schema relative' , function ( ) { assert . equal ( false , lib . url ( '//react-formstate-validation.test' ) ) ; } ) ;
172172 it ( 'does not match site relative' , function ( ) { assert . equal ( false , lib . url ( '~/react-formstate-validation.test' ) ) ; } ) ;
173173 it ( 'does not match gopher' , function ( ) { assert . equal ( false , lib . url ( 'gopher://react-formstate-validation.test' ) ) ; } ) ;
174- it ( 'does not crash' , function ( ) { assert . equal ( false , lib . url ( null ) ) ; } ) ;
174+ it ( 'matches null' , function ( ) { assert . equal ( true , lib . url ( null ) ) ; } ) ;
175+ it ( 'matches empty string' , function ( ) { assert . equal ( true , lib . url ( '' ) ) ; } ) ;
176+ it ( 'matches blank string' , function ( ) { assert . equal ( true , lib . url ( ' ' ) ) ; } ) ;
177+ it ( 'does not crash on an integer' , function ( ) { assert . equal ( false , lib . url ( 3 ) ) ; } ) ;
178+ it ( 'does not crash on an object' , function ( ) { assert . equal ( false , lib . url ( { x : 3 } ) ) ; } ) ;
175179 } ) ;
176180} ) ;
177181
@@ -337,7 +341,7 @@ describe('Messages', function() {
337341 } ) ;
338342 describe ( '#url' , function ( ) {
339343 it ( 'has a message' , function ( ) {
340- assert . equal ( 'Field must be a url' , v [ 'url' ] ( '' , 'Field' ) ) ;
344+ assert . equal ( 'Field must be a url' , v [ 'url' ] ( 'badUrl ' , 'Field' ) ) ;
341345 } ) ;
342346 it ( 'might not return a message' , function ( ) {
343347 assert . equal ( undefined , v [ 'url' ] ( 'http://test.test' , 'Field' ) ) ;
0 commit comments