From e90c4b3a4a74d3cd00f4ffd1c8b8b87242a9d7dc Mon Sep 17 00:00:00 2001 From: Pedro Nasser Date: Mon, 15 Aug 2016 23:22:41 -0300 Subject: [PATCH] changing tests --- api/server/apps_test.go | 2 +- api/server/routes_test.go | 2 +- api/server/server_test.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/server/apps_test.go b/api/server/apps_test.go index f473ab6fe..081a55e12 100644 --- a/api/server/apps_test.go +++ b/api/server/apps_test.go @@ -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) diff --git a/api/server/routes_test.go b/api/server/routes_test.go index e584af9c5..0712c3891 100644 --- a/api/server/routes_test.go +++ b/api/server/routes_test.go @@ -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) diff --git a/api/server/server_test.go b/api/server/server_test.go index 002965ad1..50377a1ad 100644 --- a/api/server/server_test.go +++ b/api/server/server_test.go @@ -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},