aboutsummaryrefslogtreecommitdiffstats
path: root/integrations/api_nodeinfo_test.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2022-05-02 15:35:45 +0200
committerGitHub <noreply@github.com>2022-05-02 21:35:45 +0800
commite2a3f3d259d230b7d1f62138e789ccdfd8f43b73 (patch)
treebfb79a507a767f82f0ecf695eea66c2777d2f09d /integrations/api_nodeinfo_test.go
parent509d8112432bd90f070e35e03f4cf78a416914fc (diff)
downloadgitea-e2a3f3d259d230b7d1f62138e789ccdfd8f43b73.tar.gz
gitea-e2a3f3d259d230b7d1f62138e789ccdfd8f43b73.zip
Federation: return useful statistic information for nodeinfo (#19561)
Add statistic information for total user count, active user count, issue count and comment count for `/nodeinfo`
Diffstat (limited to 'integrations/api_nodeinfo_test.go')
-rw-r--r--integrations/api_nodeinfo_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/integrations/api_nodeinfo_test.go b/integrations/api_nodeinfo_test.go
index 1d25dc0269..822dbf3f0e 100644
--- a/integrations/api_nodeinfo_test.go
+++ b/integrations/api_nodeinfo_test.go
@@ -26,6 +26,10 @@ func TestNodeinfo(t *testing.T) {
resp := MakeRequest(t, req, http.StatusOK)
var nodeinfo api.NodeInfo
DecodeJSON(t, resp, &nodeinfo)
+ assert.True(t, nodeinfo.OpenRegistrations)
assert.Equal(t, "gitea", nodeinfo.Software.Name)
+ assert.Equal(t, 23, nodeinfo.Usage.Users.Total)
+ assert.Equal(t, 15, nodeinfo.Usage.LocalPosts)
+ assert.Equal(t, 2, nodeinfo.Usage.LocalComments)
})
}