From c0cf68e381564d6b2a2abff061496c7d9cff1e02 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 --- 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 db978ba3cf..0ed77efe96 100644 --- a/tests/integration/issue_test.go +++ b/tests/integration/issue_test.go @@ -312,18 +312,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), })