()
| 432 | } |
| 433 | |
| 434 | func (s *MessageSuite) Test_CreateMessage_IgnoreID() { |
| 435 | auth.RegisterAuthentication(s.ctx, nil, 4, "app-token") |
| 436 | s.db.User(4).AppWithTokenAndName(8, "app-token", "Application name") |
| 437 | |
| 438 | s.ctx.Request = httptest.NewRequest("POST", "/message", strings.NewReader(`{"message": "mymessage", "id": 1337}`)) |
| 439 | s.ctx.Request.Header.Set("Content-Type", "application/json") |
| 440 | |
| 441 | s.a.CreateMessage(s.ctx) |
| 442 | |
| 443 | msgs, err := s.db.GetMessagesByApplication(8) |
| 444 | assert.NoError(s.T(), err) |
| 445 | assert.Len(s.T(), msgs, 1) |
| 446 | assert.NotEqual(s.T(), msgs[0].ID, uint(1337)) |
| 447 | assert.Equal(s.T(), 200, s.recorder.Code) |
| 448 | } |
| 449 | |
| 450 | func (s *MessageSuite) Test_CreateMessage_WithExtras() { |
| 451 | auth.RegisterAuthentication(s.ctx, nil, 4, "app-token") |
nothing calls this directly
no test coverage detected