Be tolerant about injections of CartoCSS versions

This commit is contained in:
Sandro Santilli 2012-09-27 10:42:29 +02:00
parent 11ae4d6ff1
commit 738f47d968

View File

@ -101,7 +101,7 @@ suite('server', function() {
data: querystring.stringify({style: '#my_table3{backgxxxxxround-color:#fff;}'}) data: querystring.stringify({style: '#my_table3{backgxxxxxround-color:#fff;}'})
},{ },{
status: 500, // FIXME: should be 400 ! status: 500, // FIXME: should be 400 !
body: JSON.stringify(['style.mss:1:11 Unrecognized rule: backgxxxxxround-color']) body: /Unrecognized rule: backgxxxxxround-color/
}, function() { done(); }); }, function() { done(); });
}); });
@ -125,8 +125,13 @@ suite('server', function() {
data: querystring.stringify({style: '#my_table4{backgxxxxxround-color:#fff;foo:bar}'}) data: querystring.stringify({style: '#my_table4{backgxxxxxround-color:#fff;foo:bar}'})
},{ },{
status: 500, // FIXME: should be 400 ! status: 500, // FIXME: should be 400 !
body: JSON.stringify([ 'style.mss:1:11 Unrecognized rule: backgxxxxxround-color', 'style.mss:1:38 Unrecognized rule: foo' ]) }, function(res) {
}, function() { done(); }); var parsed = JSON.parse(res.body);
assert.equal(parsed.length, 2);
assert.ok( RegExp(/Unrecognized rule: backgxxxxxround-color/).test(parsed[0]) );
assert.ok( RegExp(/Unrecognized rule: foo/).test(parsed[1]) );
done();
});
}); });
test("post'ing good style returns 200", function(done){ test("post'ing good style returns 200", function(done){