()
| 498 | } |
| 499 | |
| 500 | func (s *ApplicationSuite) Test_RemoveAppImage_expectSuccess() { |
| 501 | s.db.User(5) |
| 502 | |
| 503 | imageFile := "existing.png" |
| 504 | s.db.CreateApplication(&model.Application{UserID: 5, ID: 1, Image: imageFile}) |
| 505 | fakeImage(s.T(), imageFile) |
| 506 | |
| 507 | test.WithUser(s.ctx, 5) |
| 508 | s.ctx.Request = httptest.NewRequest("DELETE", "/irrelevant", nil) |
| 509 | s.ctx.Params = gin.Params{{Key: "id", Value: "1"}} |
| 510 | s.a.RemoveApplicationImage(s.ctx) |
| 511 | |
| 512 | _, err := os.Stat(imageFile) |
| 513 | assert.True(s.T(), os.IsNotExist(err)) |
| 514 | |
| 515 | assert.Equal(s.T(), 200, s.recorder.Code) |
| 516 | } |
| 517 | |
| 518 | func (s *ApplicationSuite) Test_UpdateApplicationNameAndDescription_expectSuccess() { |
| 519 | s.db.User(5).NewAppWithToken(2, "app-2") |
nothing calls this directly
no test coverage detected