Merge pull request #362 from CartoDB/prepare-tests-for-next-windshaft

Prepare tests for next windshaft
This commit is contained in:
Raul Ochoa 2016-01-15 18:30:50 +01:00
commit ba4db870e4
2 changed files with 4 additions and 42 deletions

View File

@ -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) { it("layergroup with no cartocss_version", function(done) {
var layergroup = { var layergroup = {
version: '1.0.0', version: '1.0.0',

View File

@ -216,8 +216,10 @@ describe('torque', function() {
assert.ok(tm0, assert.ok(tm0,
'No layer 0 in "torque" in metadata:' + JSON.stringify(tm)); 'No layer 0 in "torque" in metadata:' + JSON.stringify(tm));
var expectedTorqueMetadata = {"start":0,"end":86400000,"data_steps":2,"column_type":"date"}; var expectedTorqueMetadata = {"start":0,"end":86400000,"data_steps":2,"column_type":"date"};
assert.deepEqual(tm0, expectedTorqueMetadata); Object.keys(expectedTorqueMetadata).forEach(function(k) {
assert.deepEqual(meta.layers[0].meta, expectedTorqueMetadata); assert.equal(tm0[k], expectedTorqueMetadata[k]);
assert.equal(meta.layers[0].meta[k], expectedTorqueMetadata[k]);
});
return null; return null;
}, },
function do_get_tile(err) function do_get_tile(err)