Change expected error code for backend crash. cartodb-psql 0.4.0

returns 500 error when it's not possible to connect to PostgreSQL.
This commit is contained in:
Raul Ochoa 2014-08-20 14:52:17 +02:00
parent 2d811408c0
commit ae2c6f01d7

View File

@ -46,7 +46,7 @@ test('does not hang server', function(done){
}, },
function checkResponse(err, res) { function checkResponse(err, res) {
if ( err ) throw err; if ( err ) throw err;
assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); assert.equal(res.statusCode, 500, res.statusCode + ': ' + res.body);
var parsed = JSON.parse(res.body); var parsed = JSON.parse(res.body);
assert.ok(parsed.error); assert.ok(parsed.error);
var msg = parsed.error[0]; var msg = parsed.error[0];
@ -65,7 +65,7 @@ test('does not hang server', function(done){
}, },
function checkResponse(err, res) { function checkResponse(err, res) {
if ( err ) throw err; if ( err ) throw err;
assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); assert.equal(res.statusCode, 500, res.statusCode + ': ' + res.body);
var parsed = JSON.parse(res.body); var parsed = JSON.parse(res.body);
assert.ok(parsed.error); assert.ok(parsed.error);
var msg = parsed.error[0]; var msg = parsed.error[0];