diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-03-01 20:52:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-01 12:52:30 +0000 |
commit | 194479a7416cffdc151e6b75a895d566e5970dca (patch) | |
tree | 52c3be29370cb8701daaca9618dfeec609e55e21 /tests/integration | |
parent | 2ca5daf07e5816343c1018f5773e7a2c671f3777 (diff) | |
download | gitea-194479a7416cffdc151e6b75a895d566e5970dca.tar.gz gitea-194479a7416cffdc151e6b75a895d566e5970dca.zip |
Use a predictiable fork URL to allow forking repositories without providing a repo ID (#29519)
Close #29512
The "fork" URL:
* Before: `/repo/fork/{RepoID}`
* After: `/{OwnerName}/{RepoName}/fork`
Diffstat (limited to 'tests/integration')
-rw-r--r-- | tests/integration/repo_fork_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/integration/repo_fork_test.go b/tests/integration/repo_fork_test.go index 594fba6796..ca5d61ecc2 100644 --- a/tests/integration/repo_fork_test.go +++ b/tests/integration/repo_fork_test.go @@ -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") } |