Skip to content

Commit a0da1c4

Browse files
committed
adjust tests
1 parent 0e9d805 commit a0da1c4

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

tests/integration/repo_fork_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func testRepoFork(t *testing.T, session *TestSession, ownerName, repoName, forkO
2424
session.MakeRequest(t, req, http.StatusNotFound)
2525

2626
// Step1: go to the main page of repo
27-
req = NewRequestf(t, "GET", "/%s/%s", ownerName, repoName)
27+
req = NewRequestf(t, "GET", "/%s/%s/code", ownerName, repoName)
2828
resp := session.MakeRequest(t, req, http.StatusOK)
2929

3030
// Step2: click the fork button
@@ -49,7 +49,7 @@ func testRepoFork(t *testing.T, session *TestSession, ownerName, repoName, forkO
4949
session.MakeRequest(t, req, http.StatusSeeOther)
5050

5151
// Step4: check the existence of the forked repo
52-
req = NewRequestf(t, "GET", "/%s/%s", forkOwnerName, forkRepoName)
52+
req = NewRequestf(t, "GET", "/%s/%s/code", forkOwnerName, forkRepoName)
5353
resp = session.MakeRequest(t, req, http.StatusOK)
5454

5555
return resp

tests/integration/repo_test.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func TestViewRepo1CloneLinkAuthorized(t *testing.T) {
139139

140140
session := loginUser(t, "user2")
141141

142-
req := NewRequest(t, "GET", "/user2/repo1")
142+
req := NewRequest(t, "GET", "/user2/repo1/code")
143143
resp := session.MakeRequest(t, req, http.StatusOK)
144144

145145
htmlDoc := NewHTMLParser(t, resp.Body)
@@ -158,7 +158,11 @@ func TestViewRepoWithSymlinks(t *testing.T) {
158158
session := loginUser(t, "user2")
159159

160160
req := NewRequest(t, "GET", "/user2/repo20.git")
161-
resp := session.MakeRequest(t, req, http.StatusOK)
161+
resp := session.MakeRequest(t, req, http.StatusMovedPermanently)
162+
163+
link := resp.Result().Header.Get("Location")
164+
req = NewRequest(t, "GET", link)
165+
resp = session.MakeRequest(t, req, http.StatusOK)
162166

163167
htmlDoc := NewHTMLParser(t, resp.Body)
164168
files := htmlDoc.doc.Find("#repo-files-table > TBODY > TR > TD.name > SPAN.truncate")
@@ -269,7 +273,7 @@ func TestViewRepoDirectoryReadme(t *testing.T) {
269273
}
270274

271275
// viewing the top level
272-
check("Home", "/user2/readme-test/", "README.md", "markdown", "The cake is a lie.")
276+
check("Home", "/user2/readme-test/code", "README.md", "markdown", "The cake is a lie.")
273277

274278
// viewing different file extensions
275279
check("md", "/user2/readme-test/src/branch/master/", "README.md", "markdown", "The cake is a lie.")

0 commit comments

Comments
 (0)