Fixing tests

This commit is contained in:
Denis Makogon
2017-07-17 21:17:00 +03:00
parent b3ba42e3b9
commit bdffa75762

View File

@@ -116,7 +116,7 @@ func TestRouteDelete(t *testing.T) {
buf := setLogBuffer() buf := setLogBuffer()
routes := models.Routes{{AppName: "a", Path: "/myroute"}} routes := models.Routes{{AppName: "a", Path: "/myroute"}}
apps := []*models.App{{Name: "a", Routes: routes, Config: nil}} apps := models.Apps{{Name: "a", Routes: routes, Config: nil}}
for i, test := range []struct { for i, test := range []struct {
ds models.Datastore ds models.Datastore
@@ -126,7 +126,7 @@ func TestRouteDelete(t *testing.T) {
expectedCode int expectedCode int
expectedError error expectedError error
}{ }{
{datastore.NewMock(), logs.NewMock(), "/v1/apps/a/routes/missing", "", http.StatusNotFound, models.ErrAppsNotFound}, {datastore.NewMock(), logs.NewMock(), "/v1/apps/a/routes/missing", "", http.StatusNotFound, models.ErrRoutesNotFound},
{datastore.NewMockInit(apps, routes, nil, nil), logs.NewMock(), "/v1/apps/a/routes/myroute", "", http.StatusOK, nil}, {datastore.NewMockInit(apps, routes, nil, nil), logs.NewMock(), "/v1/apps/a/routes/myroute", "", http.StatusOK, nil},
} { } {
rnr, cancel := testRunner(t) rnr, cancel := testRunner(t)
@@ -169,7 +169,7 @@ func TestRouteList(t *testing.T) {
expectedCode int expectedCode int
expectedError error expectedError error
}{ }{
{"/v1/apps/a/routes", "", http.StatusOK, nil}, {"/v1/apps/a/routes", "", http.StatusNotFound, models.ErrAppsNotFound},
} { } {
_, rec := routerRequest(t, srv.Router, "GET", test.path, nil) _, rec := routerRequest(t, srv.Router, "GET", test.path, nil)