diff options
author | Vladimir Yakovlev <nagos@inbox.ru> | 2022-07-26 19:13:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-26 11:13:24 -0500 |
commit | 5ed082b62491f17c6c91e21f8fe7d544559b0ea1 (patch) | |
tree | ac19f17f501c1d212469bc08d329612a2d98cc9e /integrations/org_test.go | |
parent | a701fd35cf6efdecf8047cb1ee9eb683d95b1db5 (diff) | |
download | gitea-5ed082b62491f17c6c91e21f8fe7d544559b0ea1.tar.gz gitea-5ed082b62491f17c6c91e21f8fe7d544559b0ea1.zip |
Fix org members bug (#20489)
* Fix bug in public only org members list
bug was introduced in d6779c7ad3
* Expanded org unit test
Diffstat (limited to 'integrations/org_test.go')
-rw-r--r-- | integrations/org_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/integrations/org_test.go b/integrations/org_test.go index d755385726..d787e6f791 100644 --- a/integrations/org_test.go +++ b/integrations/org_test.go @@ -116,6 +116,24 @@ func TestPrivateOrg(t *testing.T) { session.MakeRequest(t, req, http.StatusOK) } +func TestOrgMembers(t *testing.T) { + defer prepareTestEnv(t)() + + // not logged in user + req := NewRequest(t, "GET", "/org/org25/members") + MakeRequest(t, req, http.StatusOK) + + // org member + session := loginUser(t, "user24") + req = NewRequest(t, "GET", "/org/org25/members") + session.MakeRequest(t, req, http.StatusOK) + + // site admin + session = loginUser(t, "user1") + req = NewRequest(t, "GET", "/org/org25/members") + session.MakeRequest(t, req, http.StatusOK) +} + func TestOrgRestrictedUser(t *testing.T) { defer prepareTestEnv(t)() |