1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-24 20:14:31 +02:00

Closing 39

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2015-04-26 18:06:18 -07:00
parent 35680ab9cb
commit ff75c9c907

View File

@ -219,17 +219,17 @@ func TestEchoGroup(t *testing.T) {
t.Errorf("should execute middleware 3, executed %s", b.String())
}
// Nested Group
// Nested group
g3 := e.Group("/group3")
g4 := g3.Group("/group4")
g4.Get("/test", func(c *Context) {
c.String(http.StatusOK, "okay")
g4.Get("/home", func(c *Context) {
c.NoContent(http.StatusOK)
})
w = httptest.NewRecorder()
r, _ = http.NewRequest(GET, "/group3/group4/test", nil)
r, _ = http.NewRequest(GET, "/group3/group4/home", nil)
e.ServeHTTP(w, r)
if w.Body.String() != "okay" {
t.Error("body should be okay")
if w.Code != 200 {
t.Errorf("status code should be 200, found %d", w.Code)
}
}