mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-10-31 22:38:58 +00:00
test PATCH /api/v1/repos/{owner}/{repo}/issues/comments/{id}
Conflicts:
tests/integration/api_comment_test.go
(cherry picked from commit 49a246f407
)
This commit is contained in:
parent
db0d71ec0f
commit
dac56f7ed7
2 changed files with 11 additions and 1 deletions
|
@ -174,10 +174,11 @@ func TestAPIGetSystemUserComment(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAPIEditComment(t *testing.T) {
|
func TestAPIEditComment(t *testing.T) {
|
||||||
|
defer tests.AddFixtures("tests/integration/fixtures/TestAPIComment/")()
|
||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
const newCommentBody = "This is the new comment body"
|
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))
|
unittest.Cond("type = ?", issues_model.CommentTypeComment))
|
||||||
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: comment.IssueID})
|
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: comment.IssueID})
|
||||||
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID})
|
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID})
|
||||||
|
|
9
tests/integration/fixtures/TestAPIComment/comment.yml
Normal file
9
tests/integration/fixtures/TestAPIComment/comment.yml
Normal file
|
@ -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
|
Loading…
Reference in a new issue