MCPcopy Index your code
hub / github.com/gotify/server / Test_DeleteUserByID_NotifyFail

Method Test_DeleteUserByID_NotifyFail

api/user_test.go:153–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151}
152
153func (s *UserSuite) Test_DeleteUserByID_NotifyFail() {
154 s.db.User(5)
155 s.notifier.OnUserDeleted(func(id uint) error {
156 if id == 5 {
157 return errors.New("some error")
158 }
159 return nil
160 })
161
162 s.ctx.Params = gin.Params{{Key: "id", Value: "5"}}
163
164 s.a.DeleteUserByID(s.ctx)
165
166 assert.Equal(s.T(), 500, s.recorder.Code)
167}
168
169func (s *UserSuite) Test_CreateUser() {
170 s.loginAdmin()

Callers

nothing calls this directly

Calls 3

UserMethod · 0.80
OnUserDeletedMethod · 0.80
DeleteUserByIDMethod · 0.65

Tested by

no test coverage detected