(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestNewConditionalHandler(t *testing.T) { |
| 10 | app := newApp() |
| 11 | e := httptest.New(t, app) |
| 12 | |
| 13 | e.GET("/api/v1/users").Expect().Status(httptest.StatusOK). |
| 14 | Body().IsEqual("requested: <b>/api/v1/users</b>") |
| 15 | e.GET("/api/v1/users").WithQuery("admin", "true").Expect().Status(httptest.StatusOK). |
| 16 | Body().IsEqual("<title>Admin</title>\n<h1>Hello Admin</h1><br>requested: <b>/api/v1/users</b>") |
| 17 | } |