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

Method Test_CreateUser_Anonymous

api/user_test.go:228–238  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

226}
227
228func (s *UserSuite) Test_CreateUser_Anonymous() {
229 s.noLogin()
230
231 s.ctx.Request = httptest.NewRequest("POST", "/user", strings.NewReader(`{"name": "tom", "pass": "1", "admin": false}`))
232 s.ctx.Request.Header.Set("Content-Type", "application/json")
233
234 s.a.CreateUser(s.ctx)
235
236 assert.Equal(s.T(), 401, s.recorder.Code)
237 s.db.AssertUsernameNotExist("tom")
238}
239
240func (s *UserSuite) Test_CreateUser_Register_Anonymous() {
241 s.a.Registration = true

Callers

nothing calls this directly

Calls 3

noLoginMethod · 0.95
CreateUserMethod · 0.65

Tested by

no test coverage detected