(t *testing.T)
| 186 | } |
| 187 | |
| 188 | func TestControllerGetByWithAllowMethods(t *testing.T) { |
| 189 | app := iris.New() |
| 190 | app.Configure(iris.WithFireMethodNotAllowed) |
| 191 | // ^ this 405 status will not be fired on POST: project/... because of |
| 192 | // .AllowMethods, but it will on PUT. |
| 193 | |
| 194 | New(app.Party("/project").AllowMethods(iris.MethodGet, iris.MethodPost)).Handle(new(testControllerGetBy)) |
| 195 | |
| 196 | e := httptest.New(t, app) |
| 197 | e.GET("/project/42").Expect().Status(httptest.StatusOK). |
| 198 | JSON().IsEqual(&testCustomStruct{Age: 42, Name: "name"}) |
| 199 | e.POST("/project/42").Expect().Status(httptest.StatusOK) |
| 200 | e.PUT("/project/42").Expect().Status(httptest.StatusMethodNotAllowed) |
| 201 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…