(t *testing.T)
| 528 | } |
| 529 | |
| 530 | func TestRouteNotAllowedDisabled(t *testing.T) { |
| 531 | router := New() |
| 532 | router.HandleMethodNotAllowed = false |
| 533 | router.POST("/path", func(c *Context) {}) |
| 534 | w := PerformRequest(router, http.MethodGet, "/path") |
| 535 | assert.Equal(t, http.StatusNotFound, w.Code) |
| 536 | |
| 537 | router.NoMethod(func(c *Context) { |
| 538 | c.String(http.StatusTeapot, "responseText") |
| 539 | }) |
| 540 | w = PerformRequest(router, http.MethodGet, "/path") |
| 541 | assert.Equal(t, "404 page not found", w.Body.String()) |
| 542 | assert.Equal(t, http.StatusNotFound, w.Code) |
| 543 | } |
| 544 | |
| 545 | func TestRouterNotFoundWithRemoveExtraSlash(t *testing.T) { |
| 546 | router := New() |
nothing calls this directly
no test coverage detected