summaryrefslogtreecommitdiffstats
path: root/tests/integration/api_repo_git_trees_test.go
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2023-12-22 00:59:59 +0100
committerGitHub <noreply@github.com>2023-12-21 23:59:59 +0000
commit838db2f8911690fa2115c6827ed73687db71bef1 (patch)
tree6c364eca7570962619d0e416dcc8b175331bbf2b /tests/integration/api_repo_git_trees_test.go
parent04b235d094218b780b62f024b7ae9716ad2e633f (diff)
downloadgitea-838db2f8911690fa2115c6827ed73687db71bef1.tar.gz
gitea-838db2f8911690fa2115c6827ed73687db71bef1.zip
Convert to url auth to header auth in tests (#28484)
Related #28390
Diffstat (limited to 'tests/integration/api_repo_git_trees_test.go')
-rw-r--r--tests/integration/api_repo_git_trees_test.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/integration/api_repo_git_trees_test.go b/tests/integration/api_repo_git_trees_test.go
index aa732b9946..8eec6d8d22 100644
--- a/tests/integration/api_repo_git_trees_test.go
+++ b/tests/integration/api_repo_git_trees_test.go
@@ -50,7 +50,8 @@ func TestAPIReposGitTrees(t *testing.T) {
}
// Test using access token for a private repo that the user of the token owns
- req := NewRequestf(t, "GET", "/api/v1/repos/%s/%s/git/trees/%s?token=%s", user2.Name, repo16.Name, repo16TreeSHA, token)
+ req := NewRequestf(t, "GET", "/api/v1/repos/%s/%s/git/trees/%s", user2.Name, repo16.Name, repo16TreeSHA).
+ AddTokenAuth(token)
MakeRequest(t, req, http.StatusOK)
// Test using bad sha
@@ -58,7 +59,8 @@ func TestAPIReposGitTrees(t *testing.T) {
MakeRequest(t, req, http.StatusBadRequest)
// Test using org repo "org3/repo3" where user2 is a collaborator
- req = NewRequestf(t, "GET", "/api/v1/repos/%s/%s/git/trees/%s?token=%s", org3.Name, repo3.Name, repo3TreeSHA, token)
+ req = NewRequestf(t, "GET", "/api/v1/repos/%s/%s/git/trees/%s", org3.Name, repo3.Name, repo3TreeSHA).
+ AddTokenAuth(token)
MakeRequest(t, req, http.StatusOK)
// Test using org repo "org3/repo3" with no user token