Home / Function/ TestRouteNotAllowedEnabled() — gin Function Reference

TestRouteNotAllowedEnabled() — gin Function Reference

Architecture documentation for the TestRouteNotAllowedEnabled() function in routes_test.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  c6792378_f688_d9e6_18ce_9a81e5bd79ea["TestRouteNotAllowedEnabled()"]
  45929e18_70ca_7c55_01e0_596be99dd824["routes_test.go"]
  c6792378_f688_d9e6_18ce_9a81e5bd79ea -->|defined in| 45929e18_70ca_7c55_01e0_596be99dd824
  9785c910_0083_377a_37b6_92b299e0e32d["PerformRequest()"]
  c6792378_f688_d9e6_18ce_9a81e5bd79ea -->|calls| 9785c910_0083_377a_37b6_92b299e0e32d
  style c6792378_f688_d9e6_18ce_9a81e5bd79ea fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

routes_test.go lines 493–506

func TestRouteNotAllowedEnabled(t *testing.T) {
	router := New()
	router.HandleMethodNotAllowed = true
	router.POST("/path", func(c *Context) {})
	w := PerformRequest(router, http.MethodGet, "/path")
	assert.Equal(t, http.StatusMethodNotAllowed, w.Code)

	router.NoMethod(func(c *Context) {
		c.String(http.StatusTeapot, "responseText")
	})
	w = PerformRequest(router, http.MethodGet, "/path")
	assert.Equal(t, "responseText", w.Body.String())
	assert.Equal(t, http.StatusTeapot, w.Code)
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does TestRouteNotAllowedEnabled() do?
TestRouteNotAllowedEnabled() is a function in the gin codebase, defined in routes_test.go.
Where is TestRouteNotAllowedEnabled() defined?
TestRouteNotAllowedEnabled() is defined in routes_test.go at line 493.
What does TestRouteNotAllowedEnabled() call?
TestRouteNotAllowedEnabled() calls 1 function(s): PerformRequest.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free