diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2023-12-22 00:59:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-21 23:59:59 +0000 |
commit | 838db2f8911690fa2115c6827ed73687db71bef1 (patch) | |
tree | 6c364eca7570962619d0e416dcc8b175331bbf2b /tests/integration/api_repo_git_ref_test.go | |
parent | 04b235d094218b780b62f024b7ae9716ad2e633f (diff) | |
download | gitea-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_ref_test.go')
-rw-r--r-- | tests/integration/api_repo_git_ref_test.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/integration/api_repo_git_ref_test.go b/tests/integration/api_repo_git_ref_test.go index 20900b3241..875752ae3f 100644 --- a/tests/integration/api_repo_git_ref_test.go +++ b/tests/integration/api_repo_git_ref_test.go @@ -24,13 +24,16 @@ func TestAPIReposGitRefs(t *testing.T) { "refs/heads/master", // Branch "refs/tags/v1.1", // Tag } { - req := NewRequestf(t, "GET", "/api/v1/repos/%s/repo1/git/%s?token="+token, user.Name, ref) + req := NewRequestf(t, "GET", "/api/v1/repos/%s/repo1/git/%s", user.Name, ref). + AddTokenAuth(token) MakeRequest(t, req, http.StatusOK) } // Test getting all refs - req := NewRequestf(t, "GET", "/api/v1/repos/%s/repo1/git/refs?token="+token, user.Name) + req := NewRequestf(t, "GET", "/api/v1/repos/%s/repo1/git/refs", user.Name). + AddTokenAuth(token) MakeRequest(t, req, http.StatusOK) // Test getting non-existent refs - req = NewRequestf(t, "GET", "/api/v1/repos/%s/repo1/git/refs/heads/unknown?token="+token, user.Name) + req = NewRequestf(t, "GET", "/api/v1/repos/%s/repo1/git/refs/heads/unknown", user.Name). + AddTokenAuth(token) MakeRequest(t, req, http.StatusNotFound) } |