6f960f23e5
- Resolves https://codeberg.org/forgejo/forgejo/issues/1226 (cherry picked from commit e383b70109325833034dd0593727e5eec3acf92d) (cherry picked from commit 029cfa34de06e7706c3f85134468f2faadf30a21) (cherry picked from commit 81392b8c55b2f5893a3222c521f697d1d53adbb2) (cherry picked from commit 0ebecca1e6edd31ec95c5d8be3d02814fb39179f) (cherry picked from commit aff135418d96b1f7418e55882ee0bbdbf2b04c5e) (cherry picked from commit b5982f5008a0a60d0cf874edbe281c3f73b69e97) (cherry picked from commit 00f86df8f4f4072eb083426e807a9164be0dbc38) (cherry picked from commit 178908c047b9a13a7b61e90490d525ddbeae45e8) (cherry picked from commit 9cc57d1b3f48a9f530fb761bd70d224d069ea1eb) (cherry picked from commit dc80ba9a97d3e8f78a9ecd3875105375611ebc45) (cherry picked from commit 5b2f1d7149b3098b6b82ae8d588068ba476eb534) (cherry picked from commit f0ab85cd06a37eb81343c830180b6283e924015c)
26 lines
520 B
Go
26 lines
520 B
Go
// Copyright The Forgejo Authors.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package integration
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
v1 "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, "1.0.0", *version.Version)
|
|
}
|