fix unit test

This commit is contained in:
Eneko Lakasta 2018-02-07 17:14:46 +01:00
parent 95538707c9
commit 6b5d6648de

View File

@ -103,8 +103,20 @@ describe('prepare-context', function() {
}); });
it('sets also dbuser for authenticated requests', function(done){ it('sets also dbuser for authenticated requests', function(done){
var req = { headers: { host: 'localhost' }, query: { map_key: '1234' }}; var req = {
var res = { set: function () {} }; 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. // FIXME: review authorize-pgconnsetup workflow, It might we are doing authorization twice.
authorize(prepareRequest(req), prepareResponse(res), function (err) { authorize(prepareRequest(req), prepareResponse(res), function (err) {