Do not use invalid MML (won't work with mapnik-2.1)

This commit is contained in:
Sandro Santilli 2012-07-09 21:06:45 +02:00
parent 15162e8c38
commit 895877be8b

View File

@ -7,6 +7,7 @@ require(__dirname + '/../test_helper');
var CartodbWindshaft = require(__dirname + '/../../lib/cartodb/cartodb_windshaft'); var CartodbWindshaft = require(__dirname + '/../../lib/cartodb/cartodb_windshaft');
var serverOptions = require(__dirname + '/../../lib/cartodb/server_options'); var serverOptions = require(__dirname + '/../../lib/cartodb/server_options');
var server = new CartodbWindshaft(serverOptions); var server = new CartodbWindshaft(serverOptions);
server.setMaxListeners(0);
suite('server', function() { suite('server', function() {
@ -70,22 +71,25 @@ suite('server', function() {
url: '/tiles/my_table5/style', url: '/tiles/my_table5/style',
method: 'POST', method: 'POST',
headers: {host: 'vizzuality.localhost.lan', 'Content-Type': 'application/x-www-form-urlencoded' }, headers: {host: 'vizzuality.localhost.lan', 'Content-Type': 'application/x-www-form-urlencoded' },
data: querystring.stringify({style: '#my_table5{background-color:#fff;}'}) data: querystring.stringify({style: 'Map {background-color:#fff;}'})
},{ },{
status: 200 }, function(res) {
}, function() { done(); }); assert.equal(res.statusCode, 200, res.body);
done();
});
}); });
test("post'ing good style returns 200 then getting returns original style", function(done){ test("post'ing good style returns 200 then getting returns original style", function(done){
var style = '#my_table5{background-color:#fff;}'; var style = 'Map {background-color:#fff;}';
assert.response(server, { assert.response(server, {
url: '/tiles/my_table5/style', url: '/tiles/my_table5/style',
method: 'POST', method: 'POST',
headers: {host: 'vizzuality.localhost.lan', 'Content-Type': 'application/x-www-form-urlencoded' }, headers: {host: 'vizzuality.localhost.lan', 'Content-Type': 'application/x-www-form-urlencoded' },
data: querystring.stringify({style: style}) data: querystring.stringify({style: style})
},{ },{
status: 200 }, function(res) {
}, function() {
assert.equal(res.statusCode, 200, res.body);
assert.response(server, { assert.response(server, {
headers: {host: 'vizzuality.localhost.lan'}, headers: {host: 'vizzuality.localhost.lan'},