From 6b5d6648de7420a76158daf07812e19bc25850e8 Mon Sep 17 00:00:00 2001 From: Eneko Lakasta Date: Wed, 7 Feb 2018 17:14:46 +0100 Subject: [PATCH] fix unit test --- test/unit/cartodb/prepare-context.test.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/unit/cartodb/prepare-context.test.js b/test/unit/cartodb/prepare-context.test.js index dbbfb8bf..61ba0c55 100644 --- a/test/unit/cartodb/prepare-context.test.js +++ b/test/unit/cartodb/prepare-context.test.js @@ -103,8 +103,20 @@ describe('prepare-context', function() { }); it('sets also dbuser for authenticated requests', function(done){ - var req = { headers: { host: 'localhost' }, query: { map_key: '1234' }}; - var res = { set: function () {} }; + var req = { + headers: { + host: 'localhost' + }, + query: { + api_key: '1234' + } + }; + var res = { + set: function () {}, + locals: { + api_key: '1234' + } + }; // FIXME: review authorize-pgconnsetup workflow, It might we are doing authorization twice. authorize(prepareRequest(req), prepareResponse(res), function (err) {