From d600fabdbcaa8eb01e7b0f6bf337fa1aa844c2da Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Mon, 25 Dec 2023 12:57:56 +0100 Subject: [PATCH] [TESTS] add TestAPIForkDifferentName (squash) do not use token= query param See https://codeberg.org/forgejo/forgejo/commit/33439b733a --- tests/integration/api_pull_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integration/api_pull_test.go b/tests/integration/api_pull_test.go index 86a8e279d8..f4640521ca 100644 --- a/tests/integration/api_pull_test.go +++ b/tests/integration/api_pull_test.go @@ -222,13 +222,13 @@ func TestAPIForkDifferentName(t *testing.T) { // Step 2: fork this repo with another name forkName := "myfork" - req := NewRequestWithJSON(t, "POST", fmt.Sprintf("/api/v1/repos/%s/%s/forks?token="+token, owner.Name, repo.Name), - &api.CreateForkOption{Name: &forkName}) + req := NewRequestWithJSON(t, "POST", fmt.Sprintf("/api/v1/repos/%s/%s/forks", owner.Name, repo.Name), + &api.CreateForkOption{Name: &forkName}).AddTokenAuth(token) MakeRequest(t, req, http.StatusAccepted) // Step 3: make a PR onto the original repo, it should succeed - req = NewRequestWithJSON(t, "POST", fmt.Sprintf("/api/v1/repos/%s/%s/pulls?state=all&token="+token, owner.Name, repo.Name), - &api.CreatePullRequestOption{Head: user.Name + ":master", Base: "master", Title: "hi"}) + req = NewRequestWithJSON(t, "POST", fmt.Sprintf("/api/v1/repos/%s/%s/pulls?state=all", owner.Name, repo.Name), + &api.CreatePullRequestOption{Head: user.Name + ":master", Base: "master", Title: "hi"}).AddTokenAuth(token) MakeRequest(t, req, http.StatusCreated) }