summaryrefslogtreecommitdiffstats
path: root/tests/integration
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-10-02 15:56:55 +0800
committerGitHub <noreply@github.com>2023-10-02 07:56:55 +0000
commit439a0cca2c84c83650fa94dea0bc9d36af347a13 (patch)
tree5fcc87bb6ceaac60a9253f76060e3c2f7b3fc0e8 /tests/integration
parente4313feefde89ad0e70b24dde523fc0d93abe8a7 (diff)
downloadgitea-439a0cca2c84c83650fa94dea0bc9d36af347a13.tar.gz
gitea-439a0cca2c84c83650fa94dea0bc9d36af347a13.zip
Test more templates for if they contain an error (#27367)
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/links_test.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/integration/links_test.go b/tests/integration/links_test.go
index 91655833af..a3937dd697 100644
--- a/tests/integration/links_test.go
+++ b/tests/integration/links_test.go
@@ -159,6 +159,7 @@ func testLinksAsUser(userName string, t *testing.T) {
"/releases/new",
//"/wiki/_pages",
"/wiki/?action=_new",
+ "/activity",
}
for _, repo := range apiRepos {
@@ -174,3 +175,35 @@ func TestLinksLogin(t *testing.T) {
testLinksAsUser("user2", t)
}
+
+func TestRepoLinks(t *testing.T) {
+ defer tests.PrepareTestEnv(t)()
+
+ // repo1 has enabled almost features, so we can test most links
+ repoLink := "/user2/repo1"
+ links := []string{
+ "/actions",
+ "/packages",
+ "/projects",
+ }
+
+ // anonymous user
+ for _, link := range links {
+ req := NewRequest(t, "GET", repoLink+link)
+ MakeRequest(t, req, http.StatusOK)
+ }
+
+ // admin/owner user
+ session := loginUser(t, "user1")
+ for _, link := range links {
+ req := NewRequest(t, "GET", repoLink+link)
+ session.MakeRequest(t, req, http.StatusOK)
+ }
+
+ // non-admin non-owner user
+ session = loginUser(t, "user2")
+ for _, link := range links {
+ req := NewRequest(t, "GET", repoLink+link)
+ session.MakeRequest(t, req, http.StatusOK)
+ }
+}