test: enhance API testing and secret management

- Add a new test case for listing repository secrets in the API integration tests

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2024-04-23 14:25:09 +08:00
parent 37287d3836
commit 40d720f574
No known key found for this signature in database
1 changed files with 6 additions and 0 deletions

View File

@ -24,6 +24,12 @@ func TestAPIRepoSecrets(t *testing.T) {
session := loginUser(t, user.Name)
token := getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeWriteRepository)
t.Run("List", func(t *testing.T) {
req := NewRequest(t, "GET", fmt.Sprintf("/api/v1/repos/%s/actions/secrets", repo.FullName())).
AddTokenAuth(token)
MakeRequest(t, req, http.StatusOK)
})
t.Run("Create", func(t *testing.T) {
cases := []struct {
Name string