From cdf24a58a23a712923d56bd5cfa42d94a17932fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Tue, 2 Dec 2025 18:20:00 -0500 Subject: [PATCH] update an org test to add a team to a repo group --- tests/integration/org_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/integration/org_test.go b/tests/integration/org_test.go index cbda19ded8..41bc5b8a94 100644 --- a/tests/integration/org_test.go +++ b/tests/integration/org_test.go @@ -11,12 +11,14 @@ import ( auth_model "code.gitea.io/gitea/models/auth" "code.gitea.io/gitea/models/db" + group_model "code.gitea.io/gitea/models/group" "code.gitea.io/gitea/models/organization" "code.gitea.io/gitea/models/perm" "code.gitea.io/gitea/models/unit" "code.gitea.io/gitea/models/unittest" user_model "code.gitea.io/gitea/models/user" api "code.gitea.io/gitea/modules/structs" + group_service "code.gitea.io/gitea/services/group" "code.gitea.io/gitea/tests" "github.com/stretchr/testify/assert" @@ -201,6 +203,12 @@ func testOrgRestrictedUser(t *testing.T) { AddTokenAuth(token) _ = adminSession.MakeRequest(t, req, http.StatusNoContent) + // we also need to give this new team access to the repo's group + g := unittest.AssertExistsAndLoadBean[*group_model.Group](t, &group_model.Group{ + ID: int64(repoGroup), + }) + assert.NoError(t, group_service.AddTeamToGroup(t.Context(), g, apiTeam.Name)) + // Now we need to check if the restrictedUser can access the repo req = NewRequest(t, "GET", "/"+orgName) restrictedSession.MakeRequest(t, req, http.StatusOK)