Skip to content

Commit b2dbc98

Browse files
committed
adjust tests (6)
1 parent 40aae71 commit b2dbc98

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/integration/repo_generate_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ func testRepoGenerate(t *testing.T, session *TestSession, templateID, templateOw
2727

2828
// Step1: go to the main page of template repo
2929
req = NewRequestf(t, "GET", "/%s/%s", templateOwnerName, templateRepoName)
30-
resp := session.MakeRequest(t, req, http.StatusOK)
30+
resp := session.MakeRequest(t, req, http.StatusMovedPermanently)
31+
req = NewRequest(t, "GET", resp.Result().Header.Get("Location"))
32+
resp = session.MakeRequest(t, req, http.StatusOK)
3133

3234
// Step2: click the "Use this template" button
3335
htmlDoc := NewHTMLParser(t, resp.Body)
@@ -53,7 +55,7 @@ func testRepoGenerate(t *testing.T, session *TestSession, templateID, templateOw
5355

5456
// Step4: check the existence of the generated repo
5557
req = NewRequestf(t, "GET", "/%s/%s", generateOwnerName, generateRepoName)
56-
session.MakeRequest(t, req, http.StatusOK)
58+
session.MakeRequest(t, req, http.StatusMovedPermanently)
5759

5860
// Step5: check substituted values in Readme
5961
req = NewRequestf(t, "GET", "/%s/%s/raw/branch/master/README.md", generateOwnerName, generateRepoName)

0 commit comments

Comments
 (0)