From 23f208b28564dd4d761bae70f483d6be2dc8ed61 Mon Sep 17 00:00:00 2001 From: Mirza Kapetanovic Date: Sun, 2 Nov 2014 10:46:29 +0100 Subject: [PATCH] Updated dependencies. Added cookie proxy test. --- package.json | 4 ++-- test/integration/multifetch.spec.js | 24 ++++++++++++++++++++++++ test/server.js | 4 ++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3581276..bc7b862 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "test": "node ./test.js" }, "dependencies": { - "pump": "~0.2.3", - "extend": "~1.2.1" + "pump": "~1.0.0", + "extend": "~2.0.0" }, "devDependencies": { "request": "~2.30.0", diff --git a/test/integration/multifetch.spec.js b/test/integration/multifetch.spec.js index aab47e7..61b4a12 100644 --- a/test/integration/multifetch.spec.js +++ b/test/integration/multifetch.spec.js @@ -365,6 +365,30 @@ describe('multifetch', function() { }); }); + describe('get proxied cookie', function() { + before(function(done) { + request.get({ + url: helper.url('/api/multifetch'), + qs: { cookie: '/cookie' }, + headers: { cookie: 'my_test_cookie' }, + json: true + }, function(err, _, result) { + body = result; + done(err); + }); + }); + + it('should be successful response', function() { + chai.expect(body).to.have.property('_error', false); + }); + + it('should contain proxied cookie', function() { + chai.expect(body) + .to.have.deep.property('cookie.body') + .to.eql({ cookie: 'my_test_cookie' }); + }); + }); + describe('get non json resource', function() { before(function(done) { request.get({ diff --git a/test/server.js b/test/server.js index 2b541c2..866fd6d 100644 --- a/test/server.js +++ b/test/server.js @@ -83,6 +83,10 @@ var create = function() { response.redirect('/api'); }); + app.get('/cookie', function(request, response) { + response.json({ cookie: request.headers.cookie }); + }); + app.get('/api', json, function(request, response) { fs.readFile(root('package.json'), function(err, data) { if(err) {