MCPcopy
hub / github.com/gotify/server / Test_UpdateUserByID_InvalidID

Method Test_UpdateUserByID_InvalidID

api/user_test.go:323–332  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

321}
322
323func (s *UserSuite) Test_UpdateUserByID_InvalidID() {
324 s.ctx.Params = gin.Params{{Key: "id", Value: "abc"}}
325
326 s.ctx.Request = httptest.NewRequest("POST", "/user/abc", strings.NewReader(`{"name": "tom", "pass": "", "admin": false}`))
327 s.ctx.Request.Header.Set("Content-Type", "application/json")
328
329 s.a.UpdateUserByID(s.ctx)
330
331 assert.Equal(s.T(), 400, s.recorder.Code)
332}
333
334func (s *UserSuite) Test_UpdateUserByID_LastAdmin_Expect400() {
335 s.db.CreateUser(&model.User{

Callers

nothing calls this directly

Calls 1

UpdateUserByIDMethod · 0.80

Tested by

no test coverage detected