From 494728f919f11e73a8178de910319a672c42e196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Sun, 12 Nov 2023 18:44:57 +0100 Subject: [PATCH] test GET /{username}/{reponame}/{type:issues|pulls}/{index}/content-history/detail (cherry picked from commit c0cf68e381564d6b2a2abff061496c7d9cff1e02) --- tests/integration/issue_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/integration/issue_test.go b/tests/integration/issue_test.go index b1d4288c5f..965b9ac639 100644 --- a/tests/integration/issue_test.go +++ b/tests/integration/issue_test.go @@ -261,18 +261,29 @@ func TestIssueCommentUpdate(t *testing.T) { assert.False(t, historyBefore.IsDeleted) softDelete := fmt.Sprintf("content-history/soft-delete?comment_id=%d&history_id=%d", commentID, historyBefore.ID) + detail := fmt.Sprintf("content-history/detail?comment_id=%d&history_id=%d", commentID, historyBefore.ID) // Using the ID of a comment that does not belong to the repository must fail { session5 := loginUser(t, "user5") otherIssueURL := testNewIssue(t, session5, "user5", "repo4", "Other Title", "Other Description") + req = NewRequestWithValues(t, "GET", fmt.Sprintf("%s/%s", otherIssueURL, detail), map[string]string{ + "_csrf": GetCSRF(t, session5, otherIssueURL), + }) + session5.MakeRequest(t, req, http.StatusNotFound) + req = NewRequestWithValues(t, "POST", fmt.Sprintf("%s/%s", otherIssueURL, softDelete), map[string]string{ "_csrf": GetCSRF(t, session5, otherIssueURL), }) session5.MakeRequest(t, req, http.StatusNotFound) } + req = NewRequestWithValues(t, "GET", fmt.Sprintf("%s/%s", issueURL, detail), map[string]string{ + "_csrf": GetCSRF(t, session, issueURL), + }) + session.MakeRequest(t, req, http.StatusOK) + req = NewRequestWithValues(t, "POST", fmt.Sprintf("%s/%s", issueURL, softDelete), map[string]string{ "_csrf": GetCSRF(t, session, issueURL), })