442 when missing mandatory fields (WIP)

This commit is contained in:
César Gallego Rodríguez
2019-10-09 13:51:34 +02:00
parent 401644b65e
commit 7c95726a8c
2 changed files with 10 additions and 6 deletions
+1 -3
View File
@@ -13,7 +13,6 @@ import (
)
func TestAddRouteReturnsBadRequestWhenMalformedJSONBody(t *testing.T) {
reqPayload := `{
method": "GET",
url_pattern": "/hello",
@@ -33,7 +32,6 @@ func TestAddRouteReturnsBadRequestWhenMalformedJSONBody(t *testing.T) {
}
func TestAddRouteReturns422ErrorWhenMandatoryFieldsMissing(t *testing.T) {
t.Skip("****** WIP ******")
reqPayload := `{
}`
@@ -83,7 +81,7 @@ func TestAddRouteReturnsCreated(t *testing.T) {
respJson := model.Route{}
if err := json.Unmarshal(resp.Body.Bytes(), &respJson); err == nil {
t.Errorf("Invalid JSON response. %s", resp.Body.String())
t.Errorf("Invalid JSON response. %s", resp.Body.String()) //FIXME: String comparsion not working
}
expectedRouteSpec := model.Route{Method: "GET", Pattern: "/hello", Entrypoint: "/bin/sh -c", Command: "echo Hello World | kapow set /response/body", Index: 0, ID: "ROUTE_XXXXXXXXXXXXXXXXXX"}