MCPcopy Create free account
hub / github.com/gotify/server / Test_CreateClient_expectBadRequestOnEmptyName

Method Test_CreateClient_expectBadRequestOnEmptyName

api/client_test.go:94–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92}
93
94func (s *ClientSuite) Test_CreateClient_expectBadRequestOnEmptyName() {
95 s.db.User(5)
96
97 test.WithUser(s.ctx, 5)
98 s.withFormData("name=&description=description_text")
99
100 s.a.CreateClient(s.ctx)
101
102 assert.Equal(s.T(), 400, s.recorder.Code)
103 if clients, err := s.db.GetClientsByUser(5); assert.NoError(s.T(), err) {
104 assert.Empty(s.T(), clients)
105 }
106}
107
108func (s *ClientSuite) Test_DeleteClient_expectNotFoundOnCurrentUserIsNotOwner() {
109 s.db.User(5).Client(7)

Callers

nothing calls this directly

Calls 5

withFormDataMethod · 0.95
WithUserFunction · 0.92
UserMethod · 0.80
CreateClientMethod · 0.65
GetClientsByUserMethod · 0.65

Tested by

no test coverage detected