Merge pull request #165 from CartoDB/CDB-3255

CDB-3255 More secure test
This commit is contained in:
Raul Ochoa 2014-08-05 00:57:59 +02:00
commit 93ed7a43be

View File

@ -1428,10 +1428,13 @@ test('GET with callback must return 200 status error even if it is an error', fu
method: 'GET' method: 'GET'
},{}, function(res) { },{}, function(res) {
assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body);
var didRunJsonCallback = false;
function foo_jsonp(body) { function foo_jsonp(body) {
assert.deepEqual(body, {"error":["must be owner of relation untitle_table_4"]}); assert.deepEqual(body, {"error":["must be owner of relation untitle_table_4"]});
didRunJsonCallback = true;
} }
eval(res.body); eval(res.body);
assert.ok(didRunJsonCallback);
done(); done();
}); });
}); });