API improvements (#410)

* api improvements, remove global Api object and reduce gin dependency

* requested changes
This commit is contained in:
Pedro Nasser
2016-12-09 15:24:35 -02:00
committed by GitHub
parent 0c3c9ff2ee
commit 49a7712e6b
18 changed files with 126 additions and 107 deletions

View File

@@ -42,7 +42,7 @@ func TestRouteRunnerGet(t *testing.T) {
expectedCode int
expectedError error
}{
{"/route", "", http.StatusBadRequest, models.ErrAppsNotFound},
{"/route", "", http.StatusBadRequest, models.ErrRunnerRouteNotFound},
{"/r/app/route", "", http.StatusNotFound, models.ErrAppsNotFound},
{"/r/myapp/route", "", http.StatusNotFound, models.ErrRunnerRouteNotFound},
} {
@@ -85,7 +85,7 @@ func TestRouteRunnerPost(t *testing.T) {
expectedCode int
expectedError error
}{
{"/route", `{ "payload": "" }`, http.StatusBadRequest, models.ErrAppsNotFound},
{"/route", `{ "payload": "" }`, http.StatusBadRequest, models.ErrRunnerRouteNotFound},
{"/r/app/route", `{ "payload": "" }`, http.StatusNotFound, models.ErrAppsNotFound},
{"/r/myapp/route", `{ "payload": "" }`, http.StatusNotFound, models.ErrRunnerRouteNotFound},
} {