()
| 321 | } |
| 322 | |
| 323 | func (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 | |
| 334 | func (s *UserSuite) Test_UpdateUserByID_LastAdmin_Expect400() { |
| 335 | s.db.CreateUser(&model.User{ |
nothing calls this directly
no test coverage detected