Skip to content

Commit 76afc93

Browse files
committed
adjust tests (2)
1 parent a0da1c4 commit 76afc93

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/integration/repo_test.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ func TestViewRepo(t *testing.T) {
2727
req := NewRequest(t, "GET", "/user2/repo1")
2828
resp := session.MakeRequest(t, req, http.StatusOK)
2929

30+
link := resp.Result().Header.Get("Location")
31+
req = NewRequest(t, "GET", link)
32+
resp = session.MakeRequest(t, req, http.StatusOK)
33+
3034
htmlDoc := NewHTMLParser(t, resp.Body)
3135
repoTopics := htmlDoc.doc.Find("#repo-topics").Children()
3236
repoSummary := htmlDoc.doc.Find(".repository-summary").Children()
@@ -44,7 +48,7 @@ func TestViewRepo(t *testing.T) {
4448
func testViewRepo(t *testing.T) {
4549
defer tests.PrepareTestEnv(t)()
4650

47-
req := NewRequest(t, "GET", "/org3/repo3")
51+
req := NewRequest(t, "GET", "/org3/repo3/code")
4852
session := loginUser(t, "user2")
4953
resp := session.MakeRequest(t, req, http.StatusOK)
5054

@@ -124,7 +128,11 @@ func TestViewRepo1CloneLinkAnonymous(t *testing.T) {
124128
defer tests.PrepareTestEnv(t)()
125129

126130
req := NewRequest(t, "GET", "/user2/repo1")
127-
resp := MakeRequest(t, req, http.StatusOK)
131+
resp := MakeRequest(t, req, http.StatusMovedPermanently)
132+
133+
link := resp.Result().Header.Get("Location")
134+
req = NewRequest(t, "GET", link)
135+
resp = MakeRequest(t, req, http.StatusOK)
128136

129137
htmlDoc := NewHTMLParser(t, resp.Body)
130138
link, exists := htmlDoc.doc.Find("#repo-clone-https").Attr("data-link")

0 commit comments

Comments
 (0)