Skip to content

Commit

Permalink
Updated dependencies. Added cookie proxy test.
Browse files Browse the repository at this point in the history
  • Loading branch information
kapetan committed Nov 2, 2014
1 parent 886cc31 commit 23f208b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
24 changes: 24 additions & 0 deletions test/integration/multifetch.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
4 changes: 4 additions & 0 deletions test/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 23f208b

Please sign in to comment.