forked from forgejo/forgejo
[API] Forgejo API /api/forgejo/v1
(cherry picked from commit 20b5669269
)
This commit is contained in:
parent
79de60a5d8
commit
1574643a6a
14 changed files with 401 additions and 3 deletions
25
tests/integration/api_forgejo_version_test.go
Normal file
25
tests/integration/api_forgejo_version_test.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Copyright The Forgejo Authors.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package integration
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/routers/api/forgejo/v1"
|
||||
"code.gitea.io/gitea/tests"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestAPIForgejoVersion(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
|
||||
req := NewRequest(t, "GET", "/api/forgejo/v1/version")
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
var version v1.Version
|
||||
DecodeJSON(t, resp, &version)
|
||||
assert.Equal(t, "development", *version.Number)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue