Improvements on API error, swagger and status code (#428)

* improvements on API error, swagger and status code

* missing validation

* removing typo

* fix if-within-if

* fix handle app delete
This commit is contained in:
Pedro Nasser
2016-12-13 19:18:52 -02:00
committed by GitHub
parent 34d6c6e101
commit 32de7d5361
13 changed files with 103 additions and 88 deletions

View File

@@ -104,11 +104,11 @@ func TestFullStack(t *testing.T) {
body string
expectedCode int
}{
{"create my app", "POST", "/v1/apps", `{ "app": { "name": "myapp" } }`, http.StatusCreated},
{"create my app", "POST", "/v1/apps", `{ "app": { "name": "myapp" } }`, http.StatusOK},
{"list apps", "GET", "/v1/apps", ``, http.StatusOK},
{"get app", "GET", "/v1/apps/myapp", ``, http.StatusOK},
{"add myroute", "POST", "/v1/apps/myapp/routes", `{ "route": { "name": "myroute", "path": "/myroute", "image": "iron/hello" } }`, http.StatusCreated},
{"add myroute2", "POST", "/v1/apps/myapp/routes", `{ "route": { "name": "myroute2", "path": "/myroute2", "image": "iron/error" } }`, http.StatusCreated},
{"add myroute", "POST", "/v1/apps/myapp/routes", `{ "route": { "name": "myroute", "path": "/myroute", "image": "iron/hello" } }`, http.StatusOK},
{"add myroute2", "POST", "/v1/apps/myapp/routes", `{ "route": { "name": "myroute2", "path": "/myroute2", "image": "iron/error" } }`, http.StatusOK},
{"get myroute", "GET", "/v1/apps/myapp/routes/myroute", ``, http.StatusOK},
{"get myroute2", "GET", "/v1/apps/myapp/routes/myroute2", ``, http.StatusOK},
{"get all routes", "GET", "/v1/apps/myapp/routes", ``, http.StatusOK},