From fa1e1fd779664f3382ceaf60966df787b923c162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 16 Mar 2018 19:56:34 +0100 Subject: [PATCH] Fix ported test by adding host header to the requests --- test/acceptance/ported/retina.js | 6 +++++- test/acceptance/ported/server_png8_format.js | 7 +++++-- test/acceptance/ported/torque_boundaries.js | 21 ++++++++++++++------ 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/test/acceptance/ported/retina.js b/test/acceptance/ported/retina.js index 7469214b..137f9738 100644 --- a/test/acceptance/ported/retina.js +++ b/test/acceptance/ported/retina.js @@ -38,6 +38,7 @@ describe('retina support', function() { url: '/database/windshaft_test/layergroup', method: 'POST', headers: { + host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(retinaSampleMapConfig) @@ -67,7 +68,10 @@ describe('retina support', function() { { url: '/database/windshaft_test/layergroup/' + layergroupId + '/0/0/0' + scaleFactor + '.png', method: 'GET', - encoding: 'binary' + encoding: 'binary', + headers: { + host: 'localhost' + } }, responseHead, assertFn diff --git a/test/acceptance/ported/server_png8_format.js b/test/acceptance/ported/server_png8_format.js index 18151330..ee565498 100644 --- a/test/acceptance/ported/server_png8_format.js +++ b/test/acceptance/ported/server_png8_format.js @@ -62,6 +62,7 @@ describe('server_png8_format', function() { url: '/database/windshaft_test/layergroup', method: 'POST', headers: { + host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) @@ -81,7 +82,10 @@ describe('server_png8_format', function() { var requestPayload = { url: '/database/windshaft_test/layergroup/' + layergroupId + tilePartialUrl, method: 'GET', - encoding: 'binary' + encoding: 'binary', + headers: { + host: 'localhost' + } }; var requestHeaders = { @@ -179,4 +183,3 @@ describe('server_png8_format', function() { }); }); }); - diff --git a/test/acceptance/ported/torque_boundaries.js b/test/acceptance/ported/torque_boundaries.js index 9b4619b1..4dde46a0 100644 --- a/test/acceptance/ported/torque_boundaries.js +++ b/test/acceptance/ported/torque_boundaries.js @@ -237,7 +237,7 @@ describe('torque boundary points', function() { assert.response(server, { url: '/database/windshaft_test/layergroup', method: 'POST', - headers: {'Content-Type': 'application/json' }, + headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(boundaryPointsMapConfig) }, {}, function (res, err) { @@ -250,7 +250,10 @@ describe('torque boundary points', function() { var partialUrl = tileRequest.z + '/' + tileRequest.x + '/' + tileRequest.y; assert.response(server, { url: '/database/windshaft_test/layergroup/' + expected_token + '/0/' + partialUrl + '.json.torque', - method: 'GET' + method: 'GET', + headers: { + host: 'localhost' + } }, {}, function (res, err) { assert.ok(!err, 'Failed to get json'); @@ -351,7 +354,7 @@ describe('torque boundary points', function() { assert.response(server, { url: '/database/windshaft_test/layergroup', method: 'POST', - headers: {'Content-Type': 'application/json' }, + headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(londonPointMapConfig) }, {}, function (res, err) { assert.ok(!err, 'Failed to create layergroup'); @@ -363,7 +366,10 @@ describe('torque boundary points', function() { assert.response(server, { url: '/database/windshaft_test/layergroup/' + layergroupId + '/0/2/1/1.json.torque', - method: 'GET' + method: 'GET', + headers: { + host: 'localhost' + } }, {}, function (res, err) { assert.ok(!err, 'Failed to request torque.json'); @@ -414,7 +420,7 @@ describe('torque boundary points', function() { assert.response(server, { url: '/database/windshaft_test/layergroup', method: 'POST', - headers: {'Content-Type': 'application/json' }, + headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(londonPointMapConfig) }, {}, function (res, err) { assert.ok(!err, 'Failed to create layergroup'); @@ -426,7 +432,10 @@ describe('torque boundary points', function() { assert.response(server, { url: '/database/windshaft_test/layergroup/' + layergroupId + '/0/13/4255/2765.json.torque', - method: 'GET' + method: 'GET', + headers: { + host: 'localhost' + } }, {}, function (res, err) { assert.ok(!err, 'Failed to request torque.json');