aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo_test.go
diff options
context:
space:
mode:
authorBo-Yi Wu <appleboy.tw@gmail.com>2017-03-03 22:35:42 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2017-03-03 22:35:42 +0800
commitd76d67de234df06dc4742a7d0d2d60070fb32fba (patch)
tree9a96b915ba13b6064e7c46fbaaf47ed4dac9a58f /models/repo_test.go
parent0afab876311a35c56a23b1f7903f9247d5673c8a (diff)
downloadgitea-d76d67de234df06dc4742a7d0d2d60070fb32fba.tar.gz
gitea-d76d67de234df06dc4742a7d0d2d60070fb32fba.zip
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.
Diffstat (limited to 'models/repo_test.go')
-rw-r--r--models/repo_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/models/repo_test.go b/models/repo_test.go
index 7c0e94a5ae..a538d44c0e 100644
--- a/models/repo_test.go
+++ b/models/repo_test.go
@@ -125,3 +125,10 @@ func TestForkRepository(t *testing.T) {
assert.Error(t, err)
assert.True(t, IsErrRepoAlreadyExist(err))
}
+
+func TestRepoAPIURL(t *testing.T) {
+ assert.NoError(t, PrepareTestDatabase())
+ repo := AssertExistsAndLoadBean(t, &Repository{ID: 10}).(*Repository)
+
+ assert.Equal(t, "https://try.gitea.io/api/v1/repos/user12/repo10", repo.APIURL())
+}