diff options
author | 6543 <6543@obermui.de> | 2020-01-12 16:43:44 +0100 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2020-01-12 23:43:44 +0800 |
commit | 10055bd2b1d18d3ccbec78cbc213e459ddb75804 (patch) | |
tree | 0c3aacafab3f852a0509c4dcd2055aa93e36c0c3 /integrations/api_org_test.go | |
parent | 497e15fdc28518ab03e2f1114fb112b8c0630e18 (diff) | |
download | gitea-10055bd2b1d18d3ccbec78cbc213e459ddb75804.tar.gz gitea-10055bd2b1d18d3ccbec78cbc213e459ddb75804.zip |
[API] add GET /orgs endpoint (#9560)
* introduce `GET /orgs`
* add TEST
* show also other VisibleType's
* update description
* refactor a lot
* SearchUserOptions by default return only public
Diffstat (limited to 'integrations/api_org_test.go')
-rw-r--r-- | integrations/api_org_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/integrations/api_org_test.go b/integrations/api_org_test.go index 34579aa1ea..551da30326 100644 --- a/integrations/api_org_test.go +++ b/integrations/api_org_test.go @@ -136,3 +136,17 @@ func TestAPIOrgDeny(t *testing.T) { MakeRequest(t, req, http.StatusNotFound) }) } + +func TestAPIGetAll(t *testing.T) { + defer prepareTestEnv(t)() + + req := NewRequestf(t, "GET", "/api/v1/orgs") + resp := MakeRequest(t, req, http.StatusOK) + + var apiOrgList []*api.Organization + DecodeJSON(t, resp, &apiOrgList) + + assert.Len(t, apiOrgList, 7) + assert.Equal(t, "org25", apiOrgList[0].FullName) + assert.Equal(t, "public", apiOrgList[0].Visibility) +} |