You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
679 B
29 lines
679 B
8 years ago
|
// 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.
|
||
|
|
||
2 years ago
|
package integration
|
||
8 years ago
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
"testing"
|
||
|
|
||
8 years ago
|
"code.gitea.io/gitea/modules/setting"
|
||
6 years ago
|
"code.gitea.io/gitea/modules/structs"
|
||
2 years ago
|
"code.gitea.io/gitea/tests"
|
||
8 years ago
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
8 years ago
|
func TestVersion(t *testing.T) {
|
||
2 years ago
|
defer tests.PrepareTestEnv(t)()
|
||
8 years ago
|
|
||
7 years ago
|
setting.AppVer = "test-version-1"
|
||
8 years ago
|
req := NewRequest(t, "GET", "/api/v1/version")
|
||
8 years ago
|
resp := MakeRequest(t, req, http.StatusOK)
|
||
8 years ago
|
|
||
6 years ago
|
var version structs.ServerVersion
|
||
8 years ago
|
DecodeJSON(t, resp, &version)
|
||
6 years ago
|
assert.Equal(t, setting.AppVer, version.Version)
|
||
8 years ago
|
}
|