()
| 151 | } |
| 152 | |
| 153 | func (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 | |
| 169 | func (s *UserSuite) Test_CreateUser() { |
| 170 | s.loginAdmin() |
nothing calls this directly
no test coverage detected