File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright 2018 The Gitea Authors. All rights reserved.
2
+ // Use of this source code is governed by a MIT-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ package integrations
6
+
7
+ import (
8
+ "net/http"
9
+ "net/url"
10
+ "testing"
11
+
12
+ "code.gitea.io/gitea/modules/setting"
13
+ api "code.gitea.io/gitea/modules/structs"
14
+
15
+ "github.com/stretchr/testify/assert"
16
+ )
17
+
18
+ func TestNodeinfo (t * testing.T ) {
19
+ onGiteaRun (t , func (* testing.T , * url.URL ) {
20
+ setting .Federation .Enabled = true
21
+ defer func () {
22
+ setting .Federation .Enabled = false
23
+ }()
24
+
25
+ req := NewRequestf (t , "GET" , "/api/v1/nodeinfo" )
26
+ resp := MakeRequest (t , req , http .StatusOK )
27
+ var nodeinfo api.NodeInfo
28
+ DecodeJSON (t , resp , & nodeinfo )
29
+ assert .Equal (t , "gitea" , nodeinfo .Software .Name )
30
+ })
31
+ }
You can’t perform that action at this time.
0 commit comments