Fix test
This commit is contained in:
parent
62f428f434
commit
66f94d9452
@ -515,6 +515,7 @@ function findStatusCode(err) {
|
||||
}
|
||||
return statusCode;
|
||||
}
|
||||
module.exports.findStatusCode = findStatusCode;
|
||||
|
||||
function statusFromErrorMessage(errMsg) {
|
||||
// Find an appropriate statusCode based on message
|
||||
|
@ -41,16 +41,16 @@ describe('windshaft', function() {
|
||||
});
|
||||
|
||||
it('different formats for postgis plugin error returns 400 as status code', function() {
|
||||
var ws = cartodbServer(serverOptions);
|
||||
|
||||
var expectedStatusCode = 400;
|
||||
assert.equal(
|
||||
ws.findStatusCode("Postgis Plugin: ERROR: column \"missing\" does not exist\n"),
|
||||
cartodbServer.findStatusCode("Postgis Plugin: ERROR: column \"missing\" does not exist\n"),
|
||||
expectedStatusCode,
|
||||
"Error status code for single line does not match"
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
ws.findStatusCode("Postgis Plugin: PSQL error:\nERROR: column \"missing\" does not exist\n"),
|
||||
cartodbServer.findStatusCode("Postgis Plugin: PSQL error:\nERROR: column \"missing\" does not exist\n"),
|
||||
expectedStatusCode,
|
||||
"Error status code for multiline/PSQL does not match"
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user