|
|
|
@ -29,14 +29,14 @@ func testRepoFork(t *testing.T, session *TestSession, ownerName, repoName, forkO |
|
|
|
|
|
|
|
|
|
// Step2: click the fork button
|
|
|
|
|
htmlDoc := NewHTMLParser(t, resp.Body) |
|
|
|
|
link, exists := htmlDoc.doc.Find("a.ui.button[href^=\"/repo/fork/\"]").Attr("href") |
|
|
|
|
link, exists := htmlDoc.doc.Find(`a.ui.button[href*="/fork"]`).Attr("href") |
|
|
|
|
assert.True(t, exists, "The template has changed") |
|
|
|
|
req = NewRequest(t, "GET", link) |
|
|
|
|
resp = session.MakeRequest(t, req, http.StatusOK) |
|
|
|
|
|
|
|
|
|
// Step3: fill the form of the forking
|
|
|
|
|
htmlDoc = NewHTMLParser(t, resp.Body) |
|
|
|
|
link, exists = htmlDoc.doc.Find("form.ui.form[action^=\"/repo/fork/\"]").Attr("action") |
|
|
|
|
link, exists = htmlDoc.doc.Find(`form.ui.form[action*="/fork"]`).Attr("action") |
|
|
|
|
assert.True(t, exists, "The template has changed") |
|
|
|
|
_, exists = htmlDoc.doc.Find(fmt.Sprintf(".owner.dropdown .item[data-value=\"%d\"]", forkOwner.ID)).Attr("data-value") |
|
|
|
|
assert.True(t, exists, fmt.Sprintf("Fork owner '%s' is not present in select box", forkOwnerName)) |
|
|
|
@ -70,6 +70,6 @@ func TestRepoForkToOrg(t *testing.T) { |
|
|
|
|
req := NewRequest(t, "GET", "/user2/repo1") |
|
|
|
|
resp := session.MakeRequest(t, req, http.StatusOK) |
|
|
|
|
htmlDoc := NewHTMLParser(t, resp.Body) |
|
|
|
|
_, exists := htmlDoc.doc.Find("a.ui.button[href^=\"/repo/fork/\"]").Attr("href") |
|
|
|
|
_, exists := htmlDoc.doc.Find(`a.ui.button[href*="/fork"]`).Attr("href") |
|
|
|
|
assert.False(t, exists, "Forking should not be allowed anymore") |
|
|
|
|
} |
|
|
|
|