Permalink
Browse files

misc

  • Loading branch information...
1 parent 3c2978b commit 6273b0ec4316701b9698a20de1d08c3633bcd2f9 @tj tj committed Nov 17, 2011
Showing with 19 additions and 0 deletions.
  1. +19 −0 test/bodyParser.js
View
@@ -56,5 +56,24 @@ describe('connect.bodyParser()', function(){
done();
});
})
+
+ it('should work with multiple fields', function(done){
+ app.request()
+ .post('/')
+ .set('Content-Type', 'multipart/form-data; boundary=foo')
+ .write('--foo\r\n')
+ .write('Content-Disposition: form-data; name="user"\r\n')
+ .write('\r\n')
+ .write('Tobi')
+ .write('\r\n--foo\r\n')
+ .write('Content-Disposition: form-data; name="age"\r\n')
+ .write('\r\n')
+ .write('1')
+ .write('\r\n--foo--')
+ .end(function(res){
+ res.body.should.equal('{"user":"Tobi","age":"1"}');
+ done();
+ });
+ })
})
})

0 comments on commit 6273b0e

Please sign in to comment.