1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-22 04:17:03 +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

@@ -121,7 +121,7 @@ type testNativeRoute struct {
status int
}
func TestRouterPolicyAdaptor(t *testing.T) {
func TestNativeRouterPolicyAdaptor(t *testing.T) {
expectedWrongMethodStatus := StatusNotFound
app := New(Configuration{FireMethodNotAllowed: true})
app.Adapt(newTestNativeRouter())
@@ -166,9 +166,9 @@ func TestRouterPolicyAdaptor(t *testing.T) {
}).ChangeName("profile")
e := httptest.New(app, t)
expected := "/profile/?user_id=42&ref=iris-go&something=anything"
expected := "/profile/?user_id=42&ref=iris-go&anything=something"
if got := app.Path("profile", "user_id", 42, "ref", "iris-go", "something", "anything"); got != expected {
if got := app.Path("profile", "user_id", 42, "ref", "iris-go", "anything", "something"); got != expected {
t.Fatalf("URLPath expected %s but got %s", expected, got)
}