File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -374,12 +374,24 @@ describe('HTTP APIs', function () {
374374 describe ( 'POST (multipart)' , function ( ) {
375375 it ( 'should create as many files as the ones passed in multipart' , function ( done ) {
376376 server . post ( '/sampleContainer/' )
377- . attach ( 'test1 ' , __dirname + '/resources/hello.html ' )
378- . attach ( 'test2 ' , __dirname + '/resources/hello.html ' )
377+ . attach ( 'timbl ' , __dirname + '/resources/timbl.jpg ' )
378+ . attach ( 'nicola ' , __dirname + '/resources/nicola.jpg ' )
379379 . expect ( 200 )
380380 . end ( function ( err ) {
381381 if ( err ) return done ( err )
382- done ( )
382+
383+ var sizeNicola = fs . statSync ( __dirname + '/resources/nicola.jpg' ) . size
384+ var sizeTim = fs . statSync ( __dirname + '/resources/timbl.jpg' ) . size
385+ var sizeNicolaLocal = fs . statSync ( __dirname + '/resources/sampleContainer/nicola.jpg' ) . size
386+ var sizeTimLocal = fs . statSync ( __dirname + '/resources/sampleContainer/timbl.jpg' ) . size
387+
388+ if ( sizeNicola === sizeNicolaLocal && sizeTim === sizeTimLocal ) {
389+ return done ( )
390+ } else {
391+ return done ( new Error ( 'Either the size (remote/local) don\'t match or files are not stored' ) )
392+ }
393+ rm ( 'sampleContainer/nicola.jpg' )
394+ rm ( 'sampleContainer/timbl.jpg' )
383395 } )
384396 } )
385397 } )
You can’t perform that action at this time.
0 commit comments