Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

nesting

  • Loading branch information...
commit 4b67e22b1a74b27024c76d57933868aaf82c90d6 1 parent 6273b0e
@tj tj authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 test/bodyParser.js
View
19 test/bodyParser.js
@@ -75,5 +75,24 @@ describe('connect.bodyParser()', function(){
done();
});
})
+
+ it('should support nesting', function(done){
+ app.request()
+ .post('/')
+ .set('Content-Type', 'multipart/form-data; boundary=foo')
+ .write('--foo\r\n')
+ .write('Content-Disposition: form-data; name="user[name]"\r\n')
+ .write('\r\n')
+ .write('tobi')
+ .write('\r\n--foo\r\n')
+ .write('Content-Disposition: form-data; name="user[age]"\r\n')
+ .write('\r\n')
+ .write('1')
+ .write('\r\n--foo--')
+ .end(function(res){
+ res.body.should.equal('{"user":{"name":"tobi","age":"1"}}');
+ done();
+ });
+ })
})
})
Please sign in to comment.
Something went wrong with that request. Please try again.