mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-23 10:02:10 +08:00
fix code coverage
This commit is contained in:
parent
86986b2312
commit
4756ed090b
@ -333,6 +333,16 @@ func TestRouteNotAllowedEnabled(t *testing.T) {
|
||||
assert.Equal(t, http.StatusTeapot, w.Code)
|
||||
}
|
||||
|
||||
func TestRouteNotAllowedEnabled2(t *testing.T) {
|
||||
router := New()
|
||||
router.HandleMethodNotAllowed = true
|
||||
// add one methodTree to trees
|
||||
router.addRoute("POST", "/", HandlersChain{func(_ *Context) {}})
|
||||
router.GET("/path2", func(c *Context) {})
|
||||
w := performRequest(router, "POST", "/path2")
|
||||
assert.Equal(t, http.StatusMethodNotAllowed, w.Code)
|
||||
}
|
||||
|
||||
func TestRouteNotAllowedDisabled(t *testing.T) {
|
||||
router := New()
|
||||
router.HandleMethodNotAllowed = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user