Merge branch 'master' into turbo-carto-tokens

This commit is contained in:
Raul Ochoa
2016-05-19 16:56:00 +02:00
6 changed files with 76 additions and 35 deletions
@@ -53,6 +53,20 @@ describe('turbo-carto for anonymous maps', function() {
var fixturePath = 'test_turbo_carto_greens_13_4011_3088.png';
this.testClient.getTile(13, 4011, 3088, imageCompareFn(fixturePath, done));
});
it('should work for different char case in quantification names', function(done) {
this.testClient = new TestClient(
makeMapconfig('#layer { marker-fill: ramp([price], colorbrewer(Greens, 3), jeNkS); }')
);
this.testClient.getLayergroup(function(err, layergroup) {
assert.ok(!err, err);
assert.ok(layergroup.hasOwnProperty('layergroupid'));
assert.ok(!layergroup.hasOwnProperty('errors'));
done();
});
});
});
describe('parsing ramp function with colorbrewer for reds and mapnik renderer', function () {
@@ -78,6 +78,21 @@ describe('turbo-carto error cases', function() {
});
});
it('should return invalid method from datasource', function(done) {
this.testClient = new TestClient(makeMapconfig(null, 'ramp([wadus_column], (red, green, blue), wadusmethod)'));
this.testClient.getLayergroup(ERROR_RESPONSE, function(err, layergroup) {
assert.ok(!err, err);
assert.ok(layergroup.hasOwnProperty('errors'));
assert.equal(layergroup.errors.length, 1);
assert.ok(layergroup.errors[0].match(/^turbo-carto/));
assert.ok(layergroup.errors[0].match(/unable\sto\scompute\sramp/i));
assert.ok(layergroup.errors[0].match(/invalid\smethod\s\"wadusmethod\"/i));
done();
});
});
it('should fail by falling back to normal carto parser', function(done) {
this.testClient = new TestClient(makeMapconfig('ramp([price], (8,24,96), (8,24,96));//(red, green, blue))'));
this.testClient.getLayergroup(ERROR_RESPONSE, function(err, layergroup) {