@@ -243,13 +243,14 @@ describe('form body parser', function() {
243243 client . end ( ) ;
244244 } ) ;
245245
246- it ( 'should parse indexed array with > 20 items ' , function ( done ) {
246+ it ( 'should return object with 25 keys ' , function ( done ) {
247247 SERVER . use ( restify . plugins . bodyParser ( ) ) ;
248248
249249 SERVER . post ( '/bodyurl2/:id' , function ( req , res , next ) {
250- assert . isArray ( req . body . items , 'items should be an array' ) ;
250+ assert . isNotArray ( req . body . items ) ;
251+ assert . isObject ( req . body . items ) ;
251252 assert . equal (
252- req . body . items . length ,
253+ Object . keys ( req . body . items ) . length ,
253254 25 ,
254255 'all 25 items should be present'
255256 ) ;
@@ -278,15 +279,16 @@ describe('form body parser', function() {
278279 client . end ( ) ;
279280 } ) ;
280281
281- it ( 'should parse array with more than 20 items ' , function ( done ) {
282+ it ( 'should return object with 23 keys ' , function ( done ) {
282283 SERVER . use ( restify . plugins . bodyParser ( ) ) ;
283284
284285 SERVER . post ( '/bodyurl2/:id' , function ( req , res , next ) {
285- assert . isArray ( req . body . items , 'items should be an array' ) ;
286+ assert . isNotArray ( req . body . items ) ;
287+ assert . isObject ( req . body . items ) ;
286288 assert . equal (
287- req . body . items . length ,
288- 25 ,
289- 'all 25 items should be present'
289+ Object . keys ( req . body . items ) . length ,
290+ 23 ,
291+ 'all 23 items should be present'
290292 ) ;
291293 res . send ( ) ;
292294 next ( ) ;
@@ -302,7 +304,7 @@ describe('form body parser', function() {
302304 'Content-Type' : 'application/x-www-form-urlencoded'
303305 }
304306 } ;
305- var items = Array . from ( { length : 25 } , function ( _ , i ) {
307+ var items = Array . from ( { length : 23 } , function ( _ , i ) {
306308 return 'items[]=value' + i ;
307309 } ) ;
308310 var client = http . request ( opts , function ( res ) {
0 commit comments