summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-07-10 08:56:16 -0400
committerGitHub <noreply@github.com>2023-07-10 12:56:16 +0000
commit2b79d3fd520c4f8f9d9e61894f3fcca6c2258efe (patch)
tree9ba8d52ed7a149a7ff51af9874a5850d2427a4c7 /tests
parentb4460cf54147e22c3f0657fbfdb680aec52a0210 (diff)
downloadgitea-2b79d3fd520c4f8f9d9e61894f3fcca6c2258efe.tar.gz
gitea-2b79d3fd520c4f8f9d9e61894f3fcca6c2258efe.zip
For API attachments, use API URL (#25639) (#25814)
Backport #25639 by @lunny Fix #25257 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/api_comment_attachment_test.go3
-rw-r--r--tests/integration/api_comment_test.go2
2 files changed, 3 insertions, 2 deletions
diff --git a/tests/integration/api_comment_attachment_test.go b/tests/integration/api_comment_attachment_test.go
index 8aa73dd368..e211376c3c 100644
--- a/tests/integration/api_comment_attachment_test.go
+++ b/tests/integration/api_comment_attachment_test.go
@@ -45,11 +45,12 @@ func TestAPIGetCommentAttachment(t *testing.T) {
var apiAttachment api.Attachment
DecodeJSON(t, resp, &apiAttachment)
- expect := convert.ToAttachment(attachment)
+ expect := convert.ToAPIAttachment(repo, attachment)
assert.Equal(t, expect.ID, apiAttachment.ID)
assert.Equal(t, expect.Name, apiAttachment.Name)
assert.Equal(t, expect.UUID, apiAttachment.UUID)
assert.Equal(t, expect.Created.Unix(), apiAttachment.Created.Unix())
+ assert.Equal(t, expect.DownloadURL, apiAttachment.DownloadURL)
}
func TestAPIListCommentAttachments(t *testing.T) {
diff --git a/tests/integration/api_comment_test.go b/tests/integration/api_comment_test.go
index c773afab3d..ee648210e5 100644
--- a/tests/integration/api_comment_test.go
+++ b/tests/integration/api_comment_test.go
@@ -128,7 +128,7 @@ func TestAPIGetComment(t *testing.T) {
DecodeJSON(t, resp, &apiComment)
assert.NoError(t, comment.LoadPoster(db.DefaultContext))
- expect := convert.ToComment(db.DefaultContext, comment)
+ expect := convert.ToAPIComment(db.DefaultContext, repo, comment)
assert.Equal(t, expect.ID, apiComment.ID)
assert.Equal(t, expect.Poster.FullName, apiComment.Poster.FullName)