iris/adaptors/gorillamux/gorillamux_test.go
Gerasimos (Makis) Maropoulos e4079e4c67 Fix .Path(...)/.Url(...) and {{url ...}}/{{ urlpath ...} on httprouter Adaptor. https://github.com/kataras/iris/issues/606
Former-commit-id: f5cb496ee151a7a85361f6ed5eeb2a8231eb2fff
2017-02-18 08:03:14 +02:00

23 lines
562 B
Go

package gorillamux_test
import (
"testing"
"gopkg.in/kataras/iris.v6"
"gopkg.in/kataras/iris.v6/adaptors/gorillamux"
)
func TestRouteURLPath(t *testing.T) {
app := iris.New()
app.Adapt(gorillamux.New())
app.None("/profile/{user_id}/{ref}/{anything:.*}", nil).ChangeName("profile")
app.Boot()
expected := "/profile/42/iris-go/something"
if got := app.Path("profile", "user_id", 42, "ref", "iris-go", "anything", "something"); got != expected {
t.Fatalf("httprouter's reverse routing 'URLPath' error: expected %s but got %s", expected, got)
}
}