Home / Function/ TestOPTIONS() — gin Function Reference

TestOPTIONS() — gin Function Reference

Architecture documentation for the TestOPTIONS() function in gins_test.go from the gin codebase.

Entity Profile

Relationship Graph

Source Code

ginS/gins_test.go lines 86–97

func TestOPTIONS(t *testing.T) {
	OPTIONS("/options", func(c *gin.Context) {
		c.String(http.StatusOK, "options")
	})

	req := httptest.NewRequest(http.MethodOptions, "/options", nil)
	w := httptest.NewRecorder()
	engine().ServeHTTP(w, req)

	assert.Equal(t, http.StatusOK, w.Code)
	assert.Equal(t, "options", w.Body.String())
}

Subdomains

Analyze Your Own Codebase

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

Try Supermodel Free