mirror of https://gitee.com/bigwinds/arangodb
Foxx: Automatically add the httpMethod to the documentation
This commit is contained in:
parent
1494286143
commit
30f23c22e6
|
@ -85,6 +85,7 @@ function SetRoutesFoxxApplicationSpec () {
|
||||||
routes = app.routingInfo.routes;
|
routes = app.routingInfo.routes;
|
||||||
|
|
||||||
app.head('/simple/route', myFunc);
|
app.head('/simple/route', myFunc);
|
||||||
|
assertEqual(routes[0].docs.httpMethod, 'HEAD');
|
||||||
assertEqual(routes[0].url.methods, ["head"]);
|
assertEqual(routes[0].url.methods, ["head"]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -93,6 +94,7 @@ function SetRoutesFoxxApplicationSpec () {
|
||||||
routes = app.routingInfo.routes;
|
routes = app.routingInfo.routes;
|
||||||
|
|
||||||
app.get('/simple/route', myFunc);
|
app.get('/simple/route', myFunc);
|
||||||
|
assertEqual(routes[0].docs.httpMethod, 'GET');
|
||||||
assertEqual(routes[0].url.methods, ["get"]);
|
assertEqual(routes[0].url.methods, ["get"]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -101,6 +103,7 @@ function SetRoutesFoxxApplicationSpec () {
|
||||||
routes = app.routingInfo.routes;
|
routes = app.routingInfo.routes;
|
||||||
|
|
||||||
app.post('/simple/route', myFunc);
|
app.post('/simple/route', myFunc);
|
||||||
|
assertEqual(routes[0].docs.httpMethod, 'POST');
|
||||||
assertEqual(routes[0].url.methods, ["post"]);
|
assertEqual(routes[0].url.methods, ["post"]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -109,6 +112,7 @@ function SetRoutesFoxxApplicationSpec () {
|
||||||
routes = app.routingInfo.routes;
|
routes = app.routingInfo.routes;
|
||||||
|
|
||||||
app.put('/simple/route', myFunc);
|
app.put('/simple/route', myFunc);
|
||||||
|
assertEqual(routes[0].docs.httpMethod, 'PUT');
|
||||||
assertEqual(routes[0].url.methods, ["put"]);
|
assertEqual(routes[0].url.methods, ["put"]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -117,6 +121,7 @@ function SetRoutesFoxxApplicationSpec () {
|
||||||
routes = app.routingInfo.routes;
|
routes = app.routingInfo.routes;
|
||||||
|
|
||||||
app.patch('/simple/route', myFunc);
|
app.patch('/simple/route', myFunc);
|
||||||
|
assertEqual(routes[0].docs.httpMethod, 'PATCH');
|
||||||
assertEqual(routes[0].url.methods, ["patch"]);
|
assertEqual(routes[0].url.methods, ["patch"]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -125,6 +130,7 @@ function SetRoutesFoxxApplicationSpec () {
|
||||||
routes = app.routingInfo.routes;
|
routes = app.routingInfo.routes;
|
||||||
|
|
||||||
app['delete']('/simple/route', myFunc);
|
app['delete']('/simple/route', myFunc);
|
||||||
|
assertEqual(routes[0].docs.httpMethod, 'DELETE');
|
||||||
assertEqual(routes[0].url.methods, ["delete"]);
|
assertEqual(routes[0].url.methods, ["delete"]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -133,6 +139,7 @@ function SetRoutesFoxxApplicationSpec () {
|
||||||
routes = app.routingInfo.routes;
|
routes = app.routingInfo.routes;
|
||||||
|
|
||||||
app.del('/simple/route', myFunc);
|
app.del('/simple/route', myFunc);
|
||||||
|
assertEqual(routes[0].docs.httpMethod, 'DELETE');
|
||||||
assertEqual(routes[0].url.methods, ["delete"]);
|
assertEqual(routes[0].url.methods, ["delete"]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -177,7 +177,8 @@ _.extend(FoxxApplication.prototype, {
|
||||||
callback: String(callback)
|
callback: String(callback)
|
||||||
},
|
},
|
||||||
docs: {
|
docs: {
|
||||||
parameters: {}
|
parameters: {},
|
||||||
|
httpMethod: method.toUpperCase()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue