Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Test for Content-Length header in multipart requests

  • Loading branch information...
commit 88c1437099090c4c9618a3ffb641d30bd5923ac7 1 parent 41cba25
@abh abh authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 test/restler.js
View
6 test/restler.js
@@ -277,12 +277,14 @@ module.exports['Multipart'] = {
'Test multipart request with simple vars': function(test) {
rest.post(host, {
- data: { a: 1, b: 'thing' },
+ data: { a: 10, b: 'thing' },
multipart: true
}).on('complete', function(data) {
test.re(data, /content-type\: multipart\/form-data/, 'should set "content-type" header')
- test.re(data, /name="a"(\s)+1/, 'should send a=1');
+ test.re(data, /name="a"(\s)+10/, 'should send a=10');
test.re(data, /name="b"(\s)+thing/, 'should send b=thing');
+ test.re(data, /content-length: 200/, 'should send content-length header');
+
test.done();
});
}
Please sign in to comment.
Something went wrong with that request. Please try again.