Skip to content

Commit 4daa422

Browse files
authored
TestAPICreatePullSameRepoSuccess: send auth token as header
1 parent c0a9680 commit 4daa422

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/integration/api_pull_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ func TestAPICreatePullSameRepoSuccess(t *testing.T) {
134134
session := loginUser(t, owner.Name)
135135
token := getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeWriteRepository)
136136

137-
req := NewRequestWithJSON(t, http.MethodPost, fmt.Sprintf("/api/v1/repos/%s/%s/pulls?token=%s", owner.Name, repo.Name, token), &api.CreatePullRequestOption{
137+
req := NewRequestWithJSON(t, http.MethodPost, fmt.Sprintf("/api/v1/repos/%s/%s/pulls", owner.Name, repo.Name), &api.CreatePullRequestOption{
138138
Head: fmt.Sprintf("%s:pr-to-update", owner.Name),
139139
Base: "master",
140140
Title: "successfully create a PR between branches of the same repository",
141-
})
141+
}).AddTokenAuth(token)
142142
MakeRequest(t, req, http.StatusCreated)
143143
MakeRequest(t, req, http.StatusUnprocessableEntity) // second request should fail
144144
}

0 commit comments

Comments
 (0)