mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 10:27:06 +00:00
fix #2158 and more
This commit is contained in:
@@ -69,9 +69,9 @@ func TestLowercaseRouting(t *testing.T) {
|
||||
e := httptest.New(t, app)
|
||||
for _, tt := range tests {
|
||||
s := strings.ToLower(tt)
|
||||
e.GET(tt).Expect().Status(httptest.StatusOK).Body().Equal(s)
|
||||
e.GET(s).Expect().Status(httptest.StatusOK).Body().Equal(s)
|
||||
e.GET(strings.ToUpper(tt)).Expect().Status(httptest.StatusOK).Body().Equal(s)
|
||||
e.GET(tt).Expect().Status(httptest.StatusOK).Body().IsEqual(s)
|
||||
e.GET(s).Expect().Status(httptest.StatusOK).Body().IsEqual(s)
|
||||
e.GET(strings.ToUpper(tt)).Expect().Status(httptest.StatusOK).Body().IsEqual(s)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ func TestRouterWrapperOrder(t *testing.T) {
|
||||
app.Get("/", func(ctx iris.Context) {}) // to not append the not found one.
|
||||
|
||||
e := httptest.New(t, app)
|
||||
e.GET("/").Expect().Status(iris.StatusOK).Body().Equal(expectedOrderStr)
|
||||
e.GET("/").Expect().Status(iris.StatusOK).Body().IsEqual(expectedOrderStr)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,9 +190,9 @@ func TestNewSubdomainPartyRedirectHandler(t *testing.T) {
|
||||
}
|
||||
|
||||
e := httptest.New(t, app)
|
||||
e.GET("/").WithURL("http://mydomain.com").Expect().Status(iris.StatusOK).Body().Equal("root index")
|
||||
e.GET("/").WithURL("http://test.mydomain.com").Expect().Status(iris.StatusOK).Body().Equal("test index")
|
||||
e.GET("/").WithURL("http://testold.mydomain.com").Expect().Status(iris.StatusOK).Body().Equal("test index")
|
||||
e.GET("/").WithURL("http://testold.mydomain.com/notfound").Expect().Status(iris.StatusNotFound).Body().Equal("test 404")
|
||||
e.GET("/").WithURL("http://leveled.testold.mydomain.com").Expect().Status(iris.StatusOK).Body().Equal("leveled.testold this can be fired")
|
||||
e.GET("/").WithURL("http://mydomain.com").Expect().Status(iris.StatusOK).Body().IsEqual("root index")
|
||||
e.GET("/").WithURL("http://test.mydomain.com").Expect().Status(iris.StatusOK).Body().IsEqual("test index")
|
||||
e.GET("/").WithURL("http://testold.mydomain.com").Expect().Status(iris.StatusOK).Body().IsEqual("test index")
|
||||
e.GET("/").WithURL("http://testold.mydomain.com/notfound").Expect().Status(iris.StatusNotFound).Body().IsEqual("test 404")
|
||||
e.GET("/").WithURL("http://leveled.testold.mydomain.com").Expect().Status(iris.StatusOK).Body().IsEqual("leveled.testold this can be fired")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user