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

Method Test_CreateClient_mapAllParameters

api/client_test.go:64–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62}
63
64func (s *ClientSuite) Test_CreateClient_mapAllParameters() {
65 s.db.User(5)
66
67 test.WithUser(s.ctx, 5)
68 s.withFormData("name=custom_name&description=description_text")
69
70 s.a.CreateClient(s.ctx)
71
72 expected := &model.Client{ID: 1, Token: firstClientToken, UserID: 5, Name: "custom_name"}
73 assert.Equal(s.T(), 200, s.recorder.Code)
74 if clients, err := s.db.GetClientsByUser(5); assert.NoError(s.T(), err) {
75 assert.Contains(s.T(), clients, expected)
76 }
77}
78
79func (s *ClientSuite) Test_CreateClient_ignoresReadOnlyPropertiesInParams() {
80 s.db.User(5)

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