mirror of https://gitee.com/bigwinds/arangodb
fixed invalid object access, added a test (#2862)
This commit is contained in:
parent
1addb727ed
commit
5e1813c5d6
|
@ -23,6 +23,16 @@ describe ArangoDB do
|
|||
doc.parsed_response['error'].should eq(true)
|
||||
doc.parsed_response['code'].should eq(400)
|
||||
end
|
||||
|
||||
it "returns an error for an invalid path" do
|
||||
cmd = api + "/foo"
|
||||
body = "{ \"query\" : \"RETURN 1\" }"
|
||||
doc = ArangoDB.log_post("#{prefix}-invalid-path", cmd, :body => body)
|
||||
doc.code.should eq(404)
|
||||
doc.headers['content-type'].should eq("application/json; charset=utf-8")
|
||||
doc.parsed_response['error'].should eq(true)
|
||||
doc.parsed_response['code'].should eq(404)
|
||||
end
|
||||
|
||||
it "returns an error if collection is unknown" do
|
||||
cmd = api
|
||||
|
|
|
@ -40,8 +40,8 @@ function post_api_explain (req, res) {
|
|||
if (req.suffix.length !== 0) {
|
||||
actions.resultNotFound(req,
|
||||
res,
|
||||
ERRORS.errors.ERROR_HTTP_NOT_FOUND.code,
|
||||
ERRORS.errors.ERROR_HTTP_NOT_FOUND.message);
|
||||
ERRORS.ERROR_HTTP_NOT_FOUND.code,
|
||||
ERRORS.ERROR_HTTP_NOT_FOUND.message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue