mirror of
https://github.com/go-gitea/gitea
synced 2025-07-09 20:17:21 +00:00
feat: expose url field on issue api. (#982)
* Add api url func. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * fix: Add unit testing. * fix: conflicts * fix: remove trim * fix: revert test function name.
This commit is contained in:
@ -33,3 +33,12 @@ func TestIssue_ReplaceLabels(t *testing.T) {
|
||||
testSuccess(1, []int64{1, 2})
|
||||
testSuccess(1, []int64{})
|
||||
}
|
||||
|
||||
func TestIssueAPIURL(t *testing.T) {
|
||||
assert.NoError(t, PrepareTestDatabase())
|
||||
issue := AssertExistsAndLoadBean(t, &Issue{ID: 1}).(*Issue)
|
||||
err := issue.LoadAttributes()
|
||||
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "https://try.gitea.io/api/v1/repos/user2/repo1/issues/1", issue.APIURL())
|
||||
}
|
||||
|
Reference in New Issue
Block a user