adjust tests (6)

This commit is contained in:
6543 2024-10-31 21:45:33 +01:00
parent 40aae71221
commit b2dbc98f8f
1 changed files with 4 additions and 2 deletions

View File

@ -27,7 +27,9 @@ func testRepoGenerate(t *testing.T, session *TestSession, templateID, templateOw
// Step1: go to the main page of template repo // Step1: go to the main page of template repo
req = NewRequestf(t, "GET", "/%s/%s", templateOwnerName, templateRepoName) req = NewRequestf(t, "GET", "/%s/%s", templateOwnerName, templateRepoName)
resp := session.MakeRequest(t, req, http.StatusOK) resp := session.MakeRequest(t, req, http.StatusMovedPermanently)
req = NewRequest(t, "GET", resp.Result().Header.Get("Location"))
resp = session.MakeRequest(t, req, http.StatusOK)
// Step2: click the "Use this template" button // Step2: click the "Use this template" button
htmlDoc := NewHTMLParser(t, resp.Body) htmlDoc := NewHTMLParser(t, resp.Body)
@ -53,7 +55,7 @@ func testRepoGenerate(t *testing.T, session *TestSession, templateID, templateOw
// Step4: check the existence of the generated repo // Step4: check the existence of the generated repo
req = NewRequestf(t, "GET", "/%s/%s", generateOwnerName, generateRepoName) req = NewRequestf(t, "GET", "/%s/%s", generateOwnerName, generateRepoName)
session.MakeRequest(t, req, http.StatusOK) session.MakeRequest(t, req, http.StatusMovedPermanently)
// Step5: check substituted values in Readme // Step5: check substituted values in Readme
req = NewRequestf(t, "GET", "/%s/%s/raw/branch/master/README.md", generateOwnerName, generateRepoName) req = NewRequestf(t, "GET", "/%s/%s/raw/branch/master/README.md", generateOwnerName, generateRepoName)