MCPcopy
hub / github.com/gotify/server / Test_CreateUser_ByNonAdmin

Method Test_CreateUser_ByNonAdmin

api/user_test.go:189–198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

187}
188
189func (s *UserSuite) Test_CreateUser_ByNonAdmin() {
190 s.loginUser()
191
192 s.ctx.Request = httptest.NewRequest("POST", "/user", strings.NewReader(`{"name": "tom", "pass": "1", "admin": false}`))
193 s.ctx.Request.Header.Set("Content-Type", "application/json")
194
195 s.a.CreateUser(s.ctx)
196
197 assert.Equal(s.T(), 403, s.recorder.Code)
198}
199
200func (s *UserSuite) Test_CreateUser_Register_ByNonAdmin() {
201 s.loginUser()

Callers

nothing calls this directly

Calls 2

loginUserMethod · 0.95
CreateUserMethod · 0.65

Tested by

no test coverage detected