()
| 238 | } |
| 239 | |
| 240 | func (s *UserSuite) Test_CreateUser_Register_Anonymous() { |
| 241 | s.a.Registration = true |
| 242 | s.noLogin() |
| 243 | |
| 244 | s.ctx.Request = httptest.NewRequest("POST", "/user", strings.NewReader(`{"name": "tom", "pass": "1", "admin": false}`)) |
| 245 | s.ctx.Request.Header.Set("Content-Type", "application/json") |
| 246 | |
| 247 | s.a.CreateUser(s.ctx) |
| 248 | |
| 249 | assert.Equal(s.T(), 200, s.recorder.Code) |
| 250 | if created, err := s.db.GetUserByName("tom"); assert.NoError(s.T(), err) { |
| 251 | assert.NotNil(s.T(), created) |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | func (s *UserSuite) Test_CreateUser_Register_Admin_Anonymous() { |
| 256 | s.a.Registration = true |
nothing calls this directly
no test coverage detected