summaryrefslogtreecommitdiffstats
path: root/models/repo_test.go
diff options
context:
space:
mode:
authormrsdizzie <info@mrsdizzie.com>2019-04-12 01:53:34 -0400
committerLauris BH <lauris@nix.lv>2019-04-12 08:53:34 +0300
commit3ff0a126e12109b6c3aceaa229dd1bf229b6ad4b (patch)
treed3201fa81e7b6dc01d238ec7b833456e47463d6c /models/repo_test.go
parent3186ef554cdbf54e1a3328ffcb35ea18105d7cb1 (diff)
downloadgitea-3ff0a126e12109b6c3aceaa229dd1bf229b6ad4b.tar.gz
gitea-3ff0a126e12109b6c3aceaa229dd1bf229b6ad4b.zip
Improve issue autolinks (#6273)
* Improve issue autolinks Update autolinks to match what github does here: Issue in same repo: #1 Issue in different repo: org/repo#1 Fixes #6264 * Use setting.AppURL when parsing URL Using setting.AppURL here is a more reliable way of parsing the current URL and what other functions in this file seem to use. * Make ComposeMetas always return a valid context * Add per repository markdown renderers for better context * Update for use of context metas Now that we include the user and repo name inside context metas, update various code and tests for this new logic
Diffstat (limited to 'models/repo_test.go')
-rw-r--r--models/repo_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/models/repo_test.go b/models/repo_test.go
index 752ffc2dd9..a5b8cce9b9 100644
--- a/models/repo_test.go
+++ b/models/repo_test.go
@@ -20,7 +20,10 @@ func TestRepo(t *testing.T) {
repo.Owner = &User{Name: "testOwner"}
repo.Units = nil
- assert.Nil(t, repo.ComposeMetas())
+
+ metas := repo.ComposeMetas()
+ assert.Equal(t, "testRepo", metas["repo"])
+ assert.Equal(t, "testOwner", metas["user"])
externalTracker := RepoUnit{
Type: UnitTypeExternalTracker,