Skip to content

Commit 9e9e1e0

Browse files
lunnyappleboy
authored andcommitted
Add public links check (#2323)
* add public links check * more links for query parameters
1 parent aec826b commit 9e9e1e0

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

integrations/links_test.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright 2017 The Gitea Authors. All rights reserved.
2+
// Use of this source code is governed by a MIT-style
3+
// license that can be found in the LICENSE file.
4+
5+
package integrations
6+
7+
import (
8+
"net/http"
9+
"testing"
10+
)
11+
12+
func TestLinksNoLogin(t *testing.T) {
13+
prepareTestEnv(t)
14+
15+
var links = []string{
16+
"/explore/repos",
17+
"/explore/repos?q=test&tab=",
18+
"/explore/users",
19+
"/explore/users?q=test&tab=",
20+
"/explore/organizations",
21+
"/explore/organizations?q=test&tab=",
22+
"/",
23+
"/user/sign_up",
24+
"/user/login",
25+
"/user/forgot_password",
26+
"/swagger",
27+
}
28+
29+
for _, link := range links {
30+
req := NewRequest(t, "GET", link)
31+
MakeRequest(t, req, http.StatusOK)
32+
}
33+
}

0 commit comments

Comments
 (0)