()
| 62 | } |
| 63 | |
| 64 | func (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 | |
| 79 | func (s *ClientSuite) Test_CreateClient_ignoresReadOnlyPropertiesInParams() { |
| 80 | s.db.User(5) |
nothing calls this directly
no test coverage detected