1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-07 20:17:05 +00:00

Fix .Path(...)/.Url(...) and {{url ...}}/{{ urlpath ...} on httprouter Adaptor. https://github.com/kataras/iris/issues/606

Former-commit-id: f5cb496ee151a7a85361f6ed5eeb2a8231eb2fff
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-02-18 08:03:14 +02:00
parent f83c7fb4e7
commit e4079e4c67
4 changed files with 103 additions and 50 deletions

View File

@@ -284,3 +284,17 @@ func TestMuxCustomErrors(t *testing.T) {
Status(r.Status).Body().Equal(r.Body)
}
}
func TestRouteURLPath(t *testing.T) {
app := iris.New()
app.Adapt(httprouter.New())
app.None("/profile/:user_id/:ref/*anything", nil).ChangeName("profile")
app.Boot()
expected := "/profile/42/iris-go/something"
if got := app.Path("profile", 42, "iris-go", "something"); got != expected {
t.Fatalf("httprouter's reverse routing 'URLPath' error: expected %s but got %s", expected, got)
}
}