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

Method Test_CreateUser_Register_Admin_Anonymous

api/user_test.go:255–266  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

253}
254
255func (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
268func (s *UserSuite) Test_CreateUser_NotifyFail() {
269 s.loginAdmin()

Callers

nothing calls this directly

Calls 3

noLoginMethod · 0.95
CreateUserMethod · 0.65

Tested by

no test coverage detected