Files
Atay-Makhzan/integrations/version_test.go
T

28 lines
645 B
Go
Raw Normal View History

// Copyright 2017 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
2017-04-25 03:24:51 -04:00
package integrations
import (
"net/http"
"testing"
2017-04-25 03:24:51 -04:00
"code.gitea.io/gitea/modules/setting"
2019-05-11 18:21:34 +08:00
"code.gitea.io/gitea/modules/structs"
"github.com/stretchr/testify/assert"
)
2017-04-25 03:24:51 -04:00
func TestVersion(t *testing.T) {
2019-11-25 23:21:37 +00:00
defer prepareTestEnv(t)()
setting.AppVer = "test-version-1"
req := NewRequest(t, "GET", "/api/v1/version")
2017-07-07 15:36:47 -04:00
resp := MakeRequest(t, req, http.StatusOK)
2019-05-11 18:21:34 +08:00
var version structs.ServerVersion
DecodeJSON(t, resp, &version)
2019-07-23 20:50:39 +02:00
assert.Equal(t, setting.AppVer, version.Version)
}