diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-07-10 17:31:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-10 09:31:19 +0000 |
commit | 0fd1672ae49a5f69fca7d90336ae75be83a21014 (patch) | |
tree | 21b651c5ae3bf4db7434ef44de1ac9b4c7865703 /tests | |
parent | 5489962aac6faf3260176a0f53cbb78c44c421a5 (diff) | |
download | gitea-0fd1672ae49a5f69fca7d90336ae75be83a21014.tar.gz gitea-0fd1672ae49a5f69fca7d90336ae75be83a21014.zip |
For API attachments, use API URL (#25639)
Fix #25257
---------
Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/api_comment_attachment_test.go | 3 | ||||
-rw-r--r-- | tests/integration/api_comment_test.go | 2 |
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) |