aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo_test.go
diff options
context:
space:
mode:
authorguillep2k <18600385+guillep2k@users.noreply.github.com>2019-11-24 13:34:44 -0300
committertechknowlogick <techknowlogick@gitea.io>2019-11-24 11:34:44 -0500
commitf25fd5c8ebc83c664b5ac1752e1c4dd11edc02a2 (patch)
treeb0e47d6b19a06dd93619013bfa25b5142acb1771 /models/repo_test.go
parent7523314ef8564e2c016168d4628f3ab11e27d7ba (diff)
downloadgitea-f25fd5c8ebc83c664b5ac1752e1c4dd11edc02a2.tar.gz
gitea-f25fd5c8ebc83c664b5ac1752e1c4dd11edc02a2.zip
Fix team links in HTML rendering (#9127)
* Fix team links in HTML rendering * Fix check and lint
Diffstat (limited to 'models/repo_test.go')
-rw-r--r--models/repo_test.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/models/repo_test.go b/models/repo_test.go
index 72a2959eb7..7a2227c820 100644
--- a/models/repo_test.go
+++ b/models/repo_test.go
@@ -17,7 +17,9 @@ import (
"github.com/stretchr/testify/assert"
)
-func TestRepo(t *testing.T) {
+func TestMetas(t *testing.T) {
+ assert.NoError(t, PrepareTestDatabase())
+
repo := &Repository{Name: "testRepo"}
repo.Owner = &User{Name: "testOwner"}
@@ -36,7 +38,7 @@ func TestRepo(t *testing.T) {
testSuccess := func(expectedStyle string) {
repo.Units = []*RepoUnit{&externalTracker}
- repo.ExternalMetas = nil
+ repo.RenderingMetas = nil
metas := repo.ComposeMetas()
assert.Equal(t, expectedStyle, metas["style"])
assert.Equal(t, "testRepo", metas["repo"])
@@ -51,6 +53,15 @@ func TestRepo(t *testing.T) {
externalTracker.ExternalTrackerConfig().ExternalTrackerStyle = markup.IssueNameStyleNumeric
testSuccess(markup.IssueNameStyleNumeric)
+
+ repo, err := GetRepositoryByID(3)
+ assert.NoError(t, err)
+
+ metas = repo.ComposeMetas()
+ assert.Contains(t, metas, "org")
+ assert.Contains(t, metas, "teams")
+ assert.Equal(t, metas["org"], "user3")
+ assert.Equal(t, metas["teams"], ",owners,team1,")
}
func TestGetRepositoryCount(t *testing.T) {