From 738f47d96810b55dc2d1ead191bc329056847159 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 27 Sep 2012 10:42:29 +0200 Subject: [PATCH] Be tolerant about injections of CartoCSS versions --- test/acceptance/server.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/acceptance/server.js b/test/acceptance/server.js index 3c2eeab9..00cf4993 100644 --- a/test/acceptance/server.js +++ b/test/acceptance/server.js @@ -101,7 +101,7 @@ suite('server', function() { data: querystring.stringify({style: '#my_table3{backgxxxxxround-color:#fff;}'}) },{ status: 500, // FIXME: should be 400 ! - body: JSON.stringify(['style.mss:1:11 Unrecognized rule: backgxxxxxround-color']) + body: /Unrecognized rule: backgxxxxxround-color/ }, function() { done(); }); }); @@ -125,8 +125,13 @@ suite('server', function() { data: querystring.stringify({style: '#my_table4{backgxxxxxround-color:#fff;foo:bar}'}) },{ 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() { done(); }); + }, function(res) { + 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){