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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user