From e00661aa34447c746df0ba3f4d53e9991289255e Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Fri, 15 Jan 2016 17:17:20 +0100 Subject: [PATCH 1/2] Remove substitution tokens in attributes service test --- .../ported/multilayer_error_cases.js | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/test/acceptance/ported/multilayer_error_cases.js b/test/acceptance/ported/multilayer_error_cases.js index 2434900d..11c11e63 100644 --- a/test/acceptance/ported/multilayer_error_cases.js +++ b/test/acceptance/ported/multilayer_error_cases.js @@ -64,46 +64,6 @@ describe('multilayer error cases', function() { }); }); - // See https://github.com/CartoDB/Windshaft/issues/154 - it("mapnik tokens cannot be used with attributes service", function(done) { - var layergroup = { - version: '1.1.0', - layers: [ - { options: { - sql: 'select cartodb_id, 1 as n, the_geom, !bbox! as b from test_table limit 1', - cartocss: '#layer { marker-fill:red }', - cartocss_version: '2.0.1', - attributes: { id:'cartodb_id', columns:['n'] }, - geom_column: 'the_geom' - } } - ] - }; - step( - function do_post() - { - var next = this; - assert.response(server, { - url: '/database/windshaft_test/layergroup', - method: 'POST', - headers: {'Content-Type': 'application/json; charset=utf-8' }, - data: JSON.stringify(layergroup) - }, {}, function(res, err) { next(err, res); }); - }, - function do_check(err, res) { - assert.equal(res.statusCode, 400, res.body); - var parsed = JSON.parse(res.body); - assert.ok(parsed.errors); - assert.equal(parsed.errors.length, 1); - var msg = parsed.errors[0]; - assert.ok(msg.match(/Attribute service cannot be activated/), msg); - return null; - }, - function finish(err) { - done(err); - } - ); - }); - it("layergroup with no cartocss_version", function(done) { var layergroup = { version: '1.0.0', From d3f5b03f13ebb9cae31b853a10c70c9431aebe14 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Fri, 15 Jan 2016 17:25:09 +0100 Subject: [PATCH 2/2] Validate current torque metadata keys --- test/acceptance/ported/torque.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/acceptance/ported/torque.js b/test/acceptance/ported/torque.js index 3d2d9d5a..2784a825 100644 --- a/test/acceptance/ported/torque.js +++ b/test/acceptance/ported/torque.js @@ -216,8 +216,10 @@ describe('torque', function() { assert.ok(tm0, 'No layer 0 in "torque" in metadata:' + JSON.stringify(tm)); var expectedTorqueMetadata = {"start":0,"end":86400000,"data_steps":2,"column_type":"date"}; - assert.deepEqual(tm0, expectedTorqueMetadata); - assert.deepEqual(meta.layers[0].meta, expectedTorqueMetadata); + Object.keys(expectedTorqueMetadata).forEach(function(k) { + assert.equal(tm0[k], expectedTorqueMetadata[k]); + assert.equal(meta.layers[0].meta[k], expectedTorqueMetadata[k]); + }); return null; }, function do_get_tile(err)