MCPcopy
hub / github.com/labstack/echo / TestGroup_POST

Function TestGroup_POST

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

Source from the content-addressed store, hash-verified

253}
254
255func TestGroup_POST(t *testing.T) {
256 e := New()
257
258 users := e.Group("/users")
259 ri := users.POST("/activate", func(c *Context) error {
260 return c.String(http.StatusTeapot, "OK")
261 })
262
263 assert.Equal(t, http.MethodPost, ri.Method)
264 assert.Equal(t, "/users/activate", ri.Path)
265 assert.Equal(t, http.MethodPost+":/users/activate", ri.Name)
266 assert.Nil(t, ri.Parameters)
267
268 status, body := request(http.MethodPost, "/users/activate", e)
269 assert.Equal(t, http.StatusTeapot, status)
270 assert.Equal(t, `OK`, body)
271}
272
273func TestGroup_PUT(t *testing.T) {
274 e := New()

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
requestFunction · 0.85
GroupMethod · 0.45
POSTMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…