Standardise API error response format

This commit is contained in:
Nick O'Leary
2015-03-30 14:16:04 +01:00
parent 7adefd6ee0
commit 2a8a885271
9 changed files with 24 additions and 26 deletions

View File

@@ -82,7 +82,7 @@ describe("flows api", function() {
if (err) {
throw err;
}
res.text.should.eql("expected error");
res.body.should.have.property("message","expected error");
done();
});
});

View File

@@ -292,7 +292,7 @@ describe("nodes api", function() {
if (err) {
throw err;
}
res.text.should.equal("Error: test error");
res.body.should.have.property("message","Error: test error");
done();
});
});
@@ -422,7 +422,7 @@ describe("nodes api", function() {
if (err) {
throw err;
}
res.text.should.equal("Error: test error");
res.body.should.have.property("message","Error: test error");
done();
});
});
@@ -461,8 +461,7 @@ describe("nodes api", function() {
if (err) {
throw err;
}
res.text.should.equal("Invalid request");
res.body.should.have.property("message","Invalid request");
done();
});
});
@@ -481,7 +480,7 @@ describe("nodes api", function() {
if (err) {
throw err;
}
res.text.should.equal("Invalid request");
res.body.should.have.property("message","Invalid request");
done();
});