Fix route update procedure

API impact:
  We need to drop default value for type because it brought this type of bugs.
  Starting this patch users should specify route type through CLI or func.yml

Closes: #222
This commit is contained in:
Denis Makogon
2017-08-15 20:39:21 +03:00
parent ab37f2568f
commit d11bafb868
4 changed files with 34 additions and 20 deletions

View File

@@ -12,6 +12,18 @@ func TestRoutes(t *testing.T) {
newRouteType := "sync"
newRoutePath := id.New().String()
t.Run("create-route-with-empty-type", func(t *testing.T) {
t.Parallel()
s := SetupDefaultSuite()
CreateApp(t, s.Context, s.Client, s.AppName, map[string]string{})
_, err := createRoute(s.Context, s.Client, s.AppName, s.RoutePath, s.Image, "",
s.RouteConfig, s.RouteHeaders)
if err == nil {
t.Errorf("Should fail with Invalid route Type.")
}
DeleteApp(t, s.Context, s.Client, s.AppName)
})
t.Run("create-route", func(t *testing.T) {
t.Parallel()
s := SetupDefaultSuite()