@@ -50,29 +50,24 @@ describe('QueryString: Ordination', function () {
5050
5151 context ( 'when use custom params' , function ( ) {
5252 it ( 'should return a JSON with custom params' , function ( ) {
53- const custom_options = { default : { sort : { created_at : 'asc' } } }
53+ const custom_options = { default : { sort : { created_at : 1 } } }
5454 const result = ordination . sort ( { } , custom_options )
55- expect ( result ) . is . not . null
56- expect ( result ) . to . have . property ( 'created_at' )
57- expect ( result . created_at ) . to . eql ( 'asc' )
55+ expect ( result . created_at ) . to . eql ( 1 )
5856 } )
5957
6058 it ( 'should return a JSON with custom parameters and those of the query' , function ( ) {
61- const custom_options = { default : { sort : { created_at : 'asc' } } }
59+ const custom_options = { default : { sort : { created_at : 1 } } }
6260 const result = ordination . sort ( { sort : '-created_at,-age,name' } , custom_options )
63- expect ( result . created_at ) . to . eql ( 'desc' )
64- expect ( result . age ) . to . eql ( 'desc' )
65- expect ( result . name ) . to . eql ( 'asc' )
61+ expect ( result . created_at ) . to . eql ( - 1 )
62+ expect ( result . age ) . to . eql ( - 1 )
63+ expect ( result . name ) . to . eql ( 1 )
6664 } )
6765 } )
6866} )
6967
7068function verify ( result ) {
71- expect ( result ) . to . have . property ( 'name' )
72- expect ( result ) . to . have . property ( 'age' )
73- expect ( result ) . to . have . property ( 'created_at' )
74- expect ( result . name ) . to . eql ( 'desc' )
75- expect ( result . age ) . to . eql ( 'asc' )
76- expect ( result . created_at ) . to . eql ( 'asc' )
69+ expect ( result . name ) . to . eql ( - 1 )
70+ expect ( result . age ) . to . eql ( 1 )
71+ expect ( result . created_at ) . to . eql ( 1 )
7772
7873}
0 commit comments