forked from forgejo/forgejo
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:
parent
0afab87631
commit
d76d67de23
4 changed files with 28 additions and 0 deletions
|
@ -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())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue