MCPcopy Index your code
hub / github.com/labstack/echo / TestGroup_HEAD

Function TestGroup_HEAD

group_test.go:201–217  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

199}
200
201func TestGroup_HEAD(t *testing.T) {
202 e := New()
203
204 users := e.Group("/users")
205 ri := users.HEAD("/activate", func(c *Context) error {
206 return c.String(http.StatusTeapot, "OK")
207 })
208
209 assert.Equal(t, http.MethodHead, ri.Method)
210 assert.Equal(t, "/users/activate", ri.Path)
211 assert.Equal(t, http.MethodHead+":/users/activate", ri.Name)
212 assert.Nil(t, ri.Parameters)
213
214 status, body := request(http.MethodHead, "/users/activate", e)
215 assert.Equal(t, http.StatusTeapot, status)
216 assert.Equal(t, `OK`, body)
217}
218
219func TestGroup_OPTIONS(t *testing.T) {
220 e := New()

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
requestFunction · 0.85
GroupMethod · 0.45
HEADMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…