mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
functions: returns HTTP error in case of route update attempt (#396)
Ensure that attempts to update route's path are properly handled with a HTTP error. Moreover, updates swagger file to make it explicit that routes are immutable. Fixes #381
This commit is contained in:
@@ -203,7 +203,17 @@ func TestRouteUpdate(t *testing.T) {
|
||||
Path: "/myroute/do",
|
||||
},
|
||||
},
|
||||
}, "/v1/apps/a/routes/myroute/do", `{ "route": { "image": "iron/hello", "path": "/myroute" } }`, http.StatusOK, nil},
|
||||
}, "/v1/apps/a/routes/myroute/do", `{ "route": { "image": "iron/hello" } }`, http.StatusOK, nil},
|
||||
|
||||
// Addresses #381
|
||||
{&datastore.Mock{
|
||||
Routes: []*models.Route{
|
||||
{
|
||||
AppName: "a",
|
||||
Path: "/myroute/do",
|
||||
},
|
||||
},
|
||||
}, "/v1/apps/a/routes/myroute/do", `{ "route": { "path": "/otherpath" } }`, http.StatusForbidden, nil},
|
||||
} {
|
||||
rnr, cancel := testRunner(t)
|
||||
router := testRouter(test.ds, &mqs.Mock{}, rnr, tasks)
|
||||
|
||||
Reference in New Issue
Block a user