mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-27 14:13:52 +03:00
[TESTS] add TestAPIForkDifferentName (squash) do not use token= query param
See https://codeberg.org/forgejo/forgejo/commit/33439b733a
This commit is contained in:
parent
c5139a75b9
commit
d600fabdbc
1 changed files with 4 additions and 4 deletions
|
@ -222,13 +222,13 @@ func TestAPIForkDifferentName(t *testing.T) {
|
||||||
|
|
||||||
// Step 2: fork this repo with another name
|
// Step 2: fork this repo with another name
|
||||||
forkName := "myfork"
|
forkName := "myfork"
|
||||||
req := NewRequestWithJSON(t, "POST", fmt.Sprintf("/api/v1/repos/%s/%s/forks?token="+token, owner.Name, repo.Name),
|
req := NewRequestWithJSON(t, "POST", fmt.Sprintf("/api/v1/repos/%s/%s/forks", owner.Name, repo.Name),
|
||||||
&api.CreateForkOption{Name: &forkName})
|
&api.CreateForkOption{Name: &forkName}).AddTokenAuth(token)
|
||||||
MakeRequest(t, req, http.StatusAccepted)
|
MakeRequest(t, req, http.StatusAccepted)
|
||||||
|
|
||||||
// Step 3: make a PR onto the original repo, it should succeed
|
// 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),
|
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"})
|
&api.CreatePullRequestOption{Head: user.Name + ":master", Base: "master", Title: "hi"}).AddTokenAuth(token)
|
||||||
MakeRequest(t, req, http.StatusCreated)
|
MakeRequest(t, req, http.StatusCreated)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue