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

Method Test_DeleteUserByID_LastAdmin_Expect400

api/user_test.go:108–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106}
107
108func (s *UserSuite) Test_DeleteUserByID_LastAdmin_Expect400() {
109 s.db.CreateUser(&model.User{
110 ID: 7,
111 Name: "admin",
112 Admin: true,
113 })
114 s.ctx.Params = gin.Params{{Key: "id", Value: "7"}}
115
116 s.a.DeleteUserByID(s.ctx)
117
118 assert.Equal(s.T(), 400, s.recorder.Code)
119}
120
121func (s *UserSuite) Test_DeleteUserByID_InvalidID() {
122 s.ctx.Params = gin.Params{{Key: "id", Value: "abc"}}

Callers

nothing calls this directly

Calls 2

CreateUserMethod · 0.65
DeleteUserByIDMethod · 0.65

Tested by

no test coverage detected