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

Function TestGroup_OPTIONS

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

Source from the content-addressed store, hash-verified

217}
218
219func TestGroup_OPTIONS(t *testing.T) {
220 e := New()
221
222 users := e.Group("/users")
223 ri := users.OPTIONS("/activate", func(c *Context) error {
224 return c.String(http.StatusTeapot, "OK")
225 })
226
227 assert.Equal(t, http.MethodOptions, ri.Method)
228 assert.Equal(t, "/users/activate", ri.Path)
229 assert.Equal(t, http.MethodOptions+":/users/activate", ri.Name)
230 assert.Nil(t, ri.Parameters)
231
232 status, body := request(http.MethodOptions, "/users/activate", e)
233 assert.Equal(t, http.StatusTeapot, status)
234 assert.Equal(t, `OK`, body)
235}
236
237func TestGroup_PATCH(t *testing.T) {
238 e := New()

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
requestFunction · 0.85
GroupMethod · 0.45
OPTIONSMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…