diff --git a/test/acceptance/multilayer_server.js b/test/acceptance/multilayer_server.js index 7c6d6a92..69a7397b 100644 --- a/test/acceptance/multilayer_server.js +++ b/test/acceptance/multilayer_server.js @@ -90,4 +90,30 @@ describe('tests from old api translated to multilayer', function() { ); }); + // Zoom is a special variable + it("Specifying zoom level in CartoCSS does not need a 'zoom' variable in SQL output", function(done){ + // NOTE: may fail if grainstore < 0.3.0 is used by Windshaft + var sql = "SELECT 'SRID=3857;POINT(0 0)'::geometry as the_geom_webmercator, 1::int as cartodb_id"; + var cartocss = '#gadm4 [ zoom>=3] { marker-fill:red; }'; + + var layergroup = singleLayergroupConfig(sql, cartocss); + + assert.response(server, + { + url: layergroupUrl, + method: 'POST', + headers: {host: 'localhost', 'Content-Type': 'application/json' }, + data: JSON.stringify(layergroup) + }, + { + status: 200 + }, + function(res) { + var parsed = JSON.parse(res.body); + assert.ok(parsed.layergroupid); + done(); + } + ); + }); + }); diff --git a/test/acceptance/server.js b/test/acceptance/server.js index a9711f95..474b22ec 100644 --- a/test/acceptance/server.js +++ b/test/acceptance/server.js @@ -6,8 +6,7 @@ var step = require('step'); var helper = require(__dirname + '/../support/test_helper'); -var IMAGE_EQUALS_TOLERANCE_PER_MIL = 20, - IMAGE_EQUALS_ZERO_TOLERANCE_PER_MIL = 0; +var IMAGE_EQUALS_TOLERANCE_PER_MIL = 20; var CartodbWindshaft = require(__dirname + '/../../lib/cartodb/cartodb_windshaft'); var serverOptions = require(__dirname + '/../../lib/cartodb/server_options')(); @@ -292,23 +291,6 @@ suite.skip('server old_api', function() { }); } - // Zoom is a special variable - test("Specifying zoom level in CartoCSS does not need a 'zoom' variable in SQL output", function(done){ - // NOTE: may fail if grainstore < 0.3.0 is used by Windshaft - var query = querystring.stringify({ - sql: "SELECT 'SRID=3857;POINT(0 0)'::geometry as the_geom_webmercator, 1::int as cartodb_id", - style: '#gadm4 [ zoom>=3] { marker-fill:red; }' - }); - assert.response(server, { - headers: {host: 'localhost'}, - url: '/tiles/gadm4/0/0/0.png?' + query, - method: 'GET' - },{}, function(res) { - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); - done(); - }); - }); - // See https://github.com/CartoDB/Windshaft-cartodb/issues/115 test.skip("get'ing tile with not-strictly-valid style", function(done) { var style = querystring.stringify({style: '#test_table{line-color:black}}', style_version: '2.0.0'});