From 5209a0937561cb9c7c8da2a1f91d9648c827ac53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Sun, 26 Nov 2023 06:33:43 +0100 Subject: [PATCH] Revert "test DELETE /api/v1/repos/{owner}/{repo}/issues/comments/{id}" This reverts commit 939a66e25c6f7aad3a979fab54463ca14ee89e70. --- tests/integration/api_comment_test.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/tests/integration/api_comment_test.go b/tests/integration/api_comment_test.go index d9b7043c29..761d4b36af 100644 --- a/tests/integration/api_comment_test.go +++ b/tests/integration/api_comment_test.go @@ -213,25 +213,14 @@ func TestAPIEditComment(t *testing.T) { } func TestAPIDeleteComment(t *testing.T) { - defer tests.AddFixtures("tests/integration/fixtures/TestAPIComment/")() defer tests.PrepareTestEnv(t)() - comment := unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: 1008}, + comment := unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{}, unittest.Cond("type = ?", issues_model.CommentTypeComment)) issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: comment.IssueID}) repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}) repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}) - t.Run("UnrelatedCommentID", func(t *testing.T) { - // Using the ID of a comment that does not belong to the repository must fail - repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 4}) - repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}) - token := getUserToken(t, repoOwner.Name, auth_model.AccessTokenScopeWriteIssue) - req := NewRequestf(t, "DELETE", "/api/v1/repos/%s/%s/issues/comments/%d?token=%s", - repoOwner.Name, repo.Name, comment.ID, token) - MakeRequest(t, req, http.StatusNotFound) - }) - token := getUserToken(t, repoOwner.Name, auth_model.AccessTokenScopeWriteIssue) req := NewRequestf(t, "DELETE", "/api/v1/repos/%s/%s/issues/comments/%d?token=%s", repoOwner.Name, repo.Name, comment.ID, token)