mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
changing tests
This commit is contained in:
@@ -30,7 +30,7 @@ func TestAppCreate(t *testing.T) {
|
||||
{"/v1/apps", `{ "app": { "name": "&&%@!#$#@$" } }`, http.StatusInternalServerError, models.ErrAppsValidationInvalidName},
|
||||
|
||||
// success
|
||||
{"/v1/apps", `{ "app": { "name": "teste" } }`, http.StatusOK, nil},
|
||||
{"/v1/apps", `{ "app": { "name": "teste" } }`, http.StatusCreated, nil},
|
||||
} {
|
||||
body := bytes.NewBuffer([]byte(test.body))
|
||||
_, rec := routerRequest(t, router, "POST", test.path, body)
|
||||
|
||||
@@ -30,7 +30,7 @@ func TestRouteCreate(t *testing.T) {
|
||||
{"/v1/apps/$/routes", `{ "route": { "image": "iron/hello", "path": "/myroute" } }`, http.StatusInternalServerError, models.ErrAppsValidationInvalidName},
|
||||
|
||||
// success
|
||||
{"/v1/apps/a/routes", `{ "route": { "name": "myroute", "image": "iron/hello", "path": "/myroute" } }`, http.StatusOK, nil},
|
||||
{"/v1/apps/a/routes", `{ "route": { "name": "myroute", "image": "iron/hello", "path": "/myroute" } }`, http.StatusCreated, nil},
|
||||
} {
|
||||
body := bytes.NewBuffer([]byte(test.body))
|
||||
_, rec := routerRequest(t, router, "POST", test.path, body)
|
||||
|
||||
@@ -35,11 +35,11 @@ func TestFullStack(t *testing.T) {
|
||||
body string
|
||||
expectedCode int
|
||||
}{
|
||||
{"POST", "/v1/apps", `{ "app": { "name": "myapp" } }`, http.StatusOK},
|
||||
{"POST", "/v1/apps", `{ "app": { "name": "myapp" } }`, http.StatusCreated},
|
||||
{"GET", "/v1/apps", ``, http.StatusOK},
|
||||
{"GET", "/v1/apps/myapp", ``, http.StatusOK},
|
||||
{"POST", "/v1/apps/myapp/routes", `{ "route": { "name": "myroute", "path": "/myroute", "image": "iron/hello" } }`, http.StatusOK},
|
||||
{"POST", "/v1/apps/myapp/routes", `{ "route": { "name": "myroute2", "path": "/myroute2", "image": "iron/error" } }`, http.StatusOK},
|
||||
{"POST", "/v1/apps/myapp/routes", `{ "route": { "name": "myroute", "path": "/myroute", "image": "iron/hello" } }`, http.StatusCreated},
|
||||
{"POST", "/v1/apps/myapp/routes", `{ "route": { "name": "myroute2", "path": "/myroute2", "image": "iron/error" } }`, http.StatusCreated},
|
||||
{"GET", "/v1/apps/myapp/routes/myroute", ``, http.StatusOK},
|
||||
{"GET", "/v1/apps/myapp/routes/myroute2", ``, http.StatusOK},
|
||||
{"GET", "/v1/apps/myapp/routes", ``, http.StatusOK},
|
||||
|
||||
Reference in New Issue
Block a user