diff options
Diffstat (limited to 'models/repo/repo_test.go')
-rw-r--r-- | models/repo/repo_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/models/repo/repo_test.go b/models/repo/repo_test.go index 6f48a22e49..92b95f1d41 100644 --- a/models/repo/repo_test.go +++ b/models/repo/repo_test.go @@ -42,3 +42,10 @@ func TestGetPrivateRepositoryCount(t *testing.T) { assert.NoError(t, err) assert.Equal(t, int64(2), count) } + +func TestRepoAPIURL(t *testing.T) { + assert.NoError(t, unittest.PrepareTestDatabase()) + repo := unittest.AssertExistsAndLoadBean(t, &Repository{ID: 10}).(*Repository) + + assert.Equal(t, "https://try.gitea.io/api/v1/repos/user12/repo10", repo.APIURL()) +} |