We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 17abc0b commit 879a8e7Copy full SHA for 879a8e7
services/context/context_test.go
@@ -26,6 +26,7 @@ func TestRemoveSessionCookieHeader(t *testing.T) {
26
}
27
28
func TestRedirectToCurrentSite(t *testing.T) {
29
+ setting.IsInTesting = true
30
defer test.MockVariableValue(&setting.AppURL, "http://localhost:3000/sub/")()
31
defer test.MockVariableValue(&setting.AppSubURL, "/sub")()
32
cases := []struct {
@@ -40,7 +41,7 @@ func TestRedirectToCurrentSite(t *testing.T) {
40
41
t.Run(c.location, func(t *testing.T) {
42
req := &http.Request{URL: &url.URL{Path: "/"}}
43
resp := httptest.NewRecorder()
- base := NewBaseContext(resp, req)
44
+ base := NewBaseContextForTest(resp, req)
45
ctx := NewWebContext(base, nil, nil)
46
ctx.RedirectToCurrentSite(c.location)
47
redirect := test.RedirectURL(resp)
0 commit comments