Skip to content

Commit 168b164

Browse files
committed
move test to repo_test
1 parent 3e86431 commit 168b164

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

integrations/links_test.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -151,26 +151,3 @@ func TestLinksLogin(t *testing.T) {
151151

152152
testLinksAsUser("user2", t)
153153
}
154-
155-
func testRepoLinksNoLogin(repoPath string, t *testing.T) {
156-
prepareTestEnv(t)
157-
158-
var links = map[string]int{
159-
"/": 200,
160-
}
161-
for link, expectedStatus := range links {
162-
req := NewRequest(t, "GET", path.Join(repoPath, link))
163-
MakeRequest(t, req, expectedStatus)
164-
}
165-
}
166-
167-
func TestRepoLinksNoLogin(t *testing.T) {
168-
var repos = []string{
169-
"user2/repo1",
170-
"user5/repo4",
171-
}
172-
173-
for _, repoPath := range repos {
174-
testRepoLinksNoLogin(repoPath, t)
175-
}
176-
}

integrations/repo_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package integrations
77
import (
88
"fmt"
99
"net/http"
10+
"path"
1011
"testing"
1112

1213
"code.gitea.io/gitea/modules/setting"
@@ -74,3 +75,26 @@ func TestViewRepo1CloneLinkAuthorized(t *testing.T) {
7475
sshURL := fmt.Sprintf("ssh://%s@%s:%d/user2/repo1.git", setting.RunUser, setting.SSH.Domain, setting.SSH.Port)
7576
assert.Equal(t, sshURL, link)
7677
}
78+
79+
func testRepoLinksNoLogin(repoPath string, t *testing.T) {
80+
prepareTestEnv(t)
81+
82+
var links = map[string]int{
83+
"/": 200,
84+
}
85+
for link, expectedStatus := range links {
86+
req := NewRequest(t, "GET", path.Join(repoPath, link))
87+
MakeRequest(t, req, expectedStatus)
88+
}
89+
}
90+
91+
func TestRepoLinksNoLogin(t *testing.T) {
92+
var repos = []string{
93+
"user2/repo1",
94+
"user5/repo4",
95+
}
96+
97+
for _, repoPath := range repos {
98+
testRepoLinksNoLogin(repoPath, t)
99+
}
100+
}

models/fixtures/repo_unit.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
config: "{}"
6969
created_unix: 946684810
7070

71-
7271
-
7372
id: 11
7473
repo_id: 4

0 commit comments

Comments
 (0)