1
0
Fork 0
forked from forgejo/forgejo

[API] Forgejo API /api/forgejo/v1

(cherry picked from commit 20b5669269)
This commit is contained in:
Earl Warren 2023-02-07 11:23:49 +01:00
parent 79de60a5d8
commit 1574643a6a
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
14 changed files with 401 additions and 3 deletions

View 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)
}