From 49a246f407c739d6e534d0f86c3b366b8fddb5db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Thu, 2 Nov 2023 14:48:57 +0100 Subject: [PATCH] test PATCH /api/v1/repos/{owner}/{repo}/issues/comments/{id} Conflicts: tests/integration/api_comment_test.go --- tests/integration/api_comment_test.go | 3 ++- tests/integration/fixtures/TestAPIComment/comment.yml | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tests/integration/fixtures/TestAPIComment/comment.yml diff --git a/tests/integration/api_comment_test.go b/tests/integration/api_comment_test.go index a16ea117f2..b64abf3bfb 100644 --- a/tests/integration/api_comment_test.go +++ b/tests/integration/api_comment_test.go @@ -326,10 +326,11 @@ func TestAPIGetSystemUserComment(t *testing.T) { } func TestAPIEditComment(t *testing.T) { + defer tests.AddFixtures("tests/integration/fixtures/TestAPIComment/")() defer tests.PrepareTestEnv(t)() const newCommentBody = "This is the new comment body" - comment := unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: 8}, + comment := unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: 1008}, 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}) diff --git a/tests/integration/fixtures/TestAPIComment/comment.yml b/tests/integration/fixtures/TestAPIComment/comment.yml new file mode 100644 index 0000000000..bf5bc3486c --- /dev/null +++ b/tests/integration/fixtures/TestAPIComment/comment.yml @@ -0,0 +1,9 @@ + +- + id: 1008 + type: 0 # comment + poster_id: 2 + issue_id: 4 # in repo_id 2 + content: "comment in private pository" + created_unix: 946684811 + updated_unix: 946684811