Fix comment API paths (#2813)
This commit is contained in:
parent
876bafb7ef
commit
c3b6383b3a
4 changed files with 278 additions and 94 deletions
|
@ -93,8 +93,8 @@ func TestAPIEditComment(t *testing.T) {
|
|||
repoOwner := models.AssertExistsAndLoadBean(t, &models.User{ID: repo.OwnerID}).(*models.User)
|
||||
|
||||
session := loginUser(t, repoOwner.Name)
|
||||
urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/issues/%d/comments/%d",
|
||||
repoOwner.Name, repo.Name, issue.Index, comment.ID)
|
||||
urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/issues/comments/%d",
|
||||
repoOwner.Name, repo.Name, comment.ID)
|
||||
req := NewRequestWithValues(t, "PATCH", urlStr, map[string]string{
|
||||
"body": newCommentBody,
|
||||
})
|
||||
|
@ -117,8 +117,8 @@ func TestAPIDeleteComment(t *testing.T) {
|
|||
repoOwner := models.AssertExistsAndLoadBean(t, &models.User{ID: repo.OwnerID}).(*models.User)
|
||||
|
||||
session := loginUser(t, repoOwner.Name)
|
||||
req := NewRequestf(t, "DELETE", "/api/v1/repos/%s/%s/issues/%d/comments/%d",
|
||||
repoOwner.Name, repo.Name, issue.Index, comment.ID)
|
||||
req := NewRequestf(t, "DELETE", "/api/v1/repos/%s/%s/issues/comments/%d",
|
||||
repoOwner.Name, repo.Name, comment.ID)
|
||||
session.MakeRequest(t, req, http.StatusNoContent)
|
||||
|
||||
models.AssertNotExistsBean(t, &models.Comment{ID: comment.ID})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue