diff --git a/test/test-post.js b/test/test-post.js index 4a33943..3153e96 100644 --- a/test/test-post.js +++ b/test/test-post.js @@ -9,6 +9,11 @@ s.on('/', function (req, res) { req.pipe(res); }); +s.on('/method', function (req, res) { + res.setHeader('method', req.method); + res.end(); +}); + s.on('/empty', function (req, res) { res.end(); }); @@ -19,6 +24,20 @@ tape('setup', function (t) { }); }); +tape('GET can have body', function (t) { + t.plan(3); + + var stream = from(['wow']); + stream.on('end', function () { + t.ok(true); // Ensure, that stream was dumped + }); + + got.get(s.url + '/method', {body: stream}, function (err, data, res) { + t.error(err); + t.equal(res.headers.method, 'GET'); + }); +}); + tape('send data from options with post request', function (t) { t.plan(3);