summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2024-03-06 21:46:20 +0100
committerGusted <postmaster@gusted.xyz>2024-03-06 21:47:44 +0100
commit8f55cf199da3f2a23350f0adeb3118ea6456e9fa (patch)
treebeef34e8e259d4e2cff3fabea9bfb9ca298d9487 /routers
parentMerge pull request '[BUG] Disable CODEOWNERS for forked repositories' (#2537)... (diff)
downloadforgejo-8f55cf199da3f2a23350f0adeb3118ea6456e9fa.tar.xz
forgejo-8f55cf199da3f2a23350f0adeb3118ea6456e9fa.zip
Port "Fix wrong test usage of AppSubURL"
- Port of https://github.com/go-gitea/gitea/pull/29459 - The tests use an invalid `setting.AppSubURL`. The wrong behaviour disturbs other PRs like https://github.com/go-gitea/gitea/pull/29222 and https://github.com/go-gitea/gitea/pull/29427.
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/misc/markup_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/routers/api/v1/misc/markup_test.go b/routers/api/v1/misc/markup_test.go
index f499501c2f..5236fd06ae 100644
--- a/routers/api/v1/misc/markup_test.go
+++ b/routers/api/v1/misc/markup_test.go
@@ -20,9 +20,9 @@ import (
)
const (
- AppURL = "http://localhost:3000/"
- Repo = "gogits/gogs"
- AppSubURL = AppURL + Repo + "/"
+ AppURL = "http://localhost:3000/"
+ Repo = "gogits/gogs"
+ FullURL = AppURL + Repo + "/"
)
func testRenderMarkup(t *testing.T, mode, filePath, text, responseBody string, responseCode int) {
@@ -74,20 +74,20 @@ func TestAPI_RenderGFM(t *testing.T) {
// rendered
`<p>Wiki! Enjoy :)</p>
<ul>
-<li><a href="` + AppSubURL + `wiki/Links" rel="nofollow">Links, Language bindings, Engine bindings</a></li>
-<li><a href="` + AppSubURL + `wiki/Tips" rel="nofollow">Tips</a></li>
+<li><a href="` + FullURL + `wiki/Links" rel="nofollow">Links, Language bindings, Engine bindings</a></li>
+<li><a href="` + FullURL + `wiki/Tips" rel="nofollow">Tips</a></li>
<li>Bezier widget (by <a href="` + AppURL + `r-lyeh" rel="nofollow">@r-lyeh</a>) <a href="https://github.com/ocornut/imgui/issues/786" rel="nofollow">https://github.com/ocornut/imgui/issues/786</a></li>
</ul>
`,
// Guard wiki sidebar: special syntax
`[[Guardfile-DSL / Configuring-Guard|Guardfile-DSL---Configuring-Guard]]`,
// rendered
- `<p><a href="` + AppSubURL + `wiki/Guardfile-DSL---Configuring-Guard" rel="nofollow">Guardfile-DSL / Configuring-Guard</a></p>
+ `<p><a href="` + FullURL + `wiki/Guardfile-DSL---Configuring-Guard" rel="nofollow">Guardfile-DSL / Configuring-Guard</a></p>
`,
// special syntax
`[[Name|Link]]`,
// rendered
- `<p><a href="` + AppSubURL + `wiki/Link" rel="nofollow">Name</a></p>
+ `<p><a href="` + FullURL + `wiki/Link" rel="nofollow">Name</a></p>
`,
// empty
``,
@@ -111,8 +111,8 @@ Here are some links to the most important topics. You can find the full list of
<p><strong>Wine Staging</strong> on website <a href="http://wine-staging.com" rel="nofollow">wine-staging.com</a>.</p>
<h2 id="user-content-quick-links">Quick Links</h2>
<p>Here are some links to the most important topics. You can find the full list of pages at the sidebar.</p>
-<p><a href="` + AppSubURL + `wiki/Configuration" rel="nofollow">Configuration</a>
-<a href="` + AppSubURL + `wiki/raw/images/icon-bug.png" rel="nofollow"><img src="` + AppSubURL + `wiki/raw/images/icon-bug.png" title="icon-bug.png" alt="images/icon-bug.png"/></a></p>
+<p><a href="` + FullURL + `wiki/Configuration" rel="nofollow">Configuration</a>
+<a href="` + FullURL + `wiki/raw/images/icon-bug.png" rel="nofollow"><img src="` + FullURL + `wiki/raw/images/icon-bug.png" title="icon-bug.png" alt="images/icon-bug.png"/></a></p>
`,
}