From 11ae4d6ff1f95bd56d181a1ce66a65ecec665633 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Wed, 26 Sep 2012 16:35:15 +0200 Subject: [PATCH] Add test to check survival to unparseable style --- test/acceptance/server.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/acceptance/server.js b/test/acceptance/server.js index 96d819d6..3c2eeab9 100644 --- a/test/acceptance/server.js +++ b/test/acceptance/server.js @@ -104,6 +104,18 @@ suite('server', function() { body: JSON.stringify(['style.mss:1:11 Unrecognized rule: backgxxxxxround-color']) }, function() { done(); }); }); + + test("post'ing unparseable style returns 400 with error", function(done){ + assert.response(server, { + url: '/tiles/my_table3/style?map_key=1234', + method: 'POST', + headers: {host: 'vizzuality.localhost.lan', 'Content-Type': 'application/x-www-form-urlencoded' }, + data: querystring.stringify({style: '#my_table3{'}) + },{ + status: 500, // FIXME: should be 400 ! + body: /Missing closing/ + }, function() { done(); }); + }); test("post'ing multiple bad styles returns 400 with error array", function(done){ assert.response(server, {