()
| 253 | } |
| 254 | |
| 255 | func (s *UserSuite) Test_CreateUser_Register_Admin_Anonymous() { |
| 256 | s.a.Registration = true |
| 257 | s.noLogin() |
| 258 | |
| 259 | s.ctx.Request = httptest.NewRequest("POST", "/user", strings.NewReader(`{"name": "tom", "pass": "1", "admin": true}`)) |
| 260 | s.ctx.Request.Header.Set("Content-Type", "application/json") |
| 261 | |
| 262 | s.a.CreateUser(s.ctx) |
| 263 | |
| 264 | assert.Equal(s.T(), 401, s.recorder.Code) |
| 265 | s.db.AssertUsernameNotExist("tom") |
| 266 | } |
| 267 | |
| 268 | func (s *UserSuite) Test_CreateUser_NotifyFail() { |
| 269 | s.loginAdmin() |
nothing calls this directly
no test coverage detected