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.

version_test.go 631B

123456789101112131415161718192021222324252627
  1. // Copyright 2017 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package integrations
  5. import (
  6. "net/http"
  7. "testing"
  8. "code.gitea.io/gitea/modules/setting"
  9. "code.gitea.io/sdk/gitea"
  10. "github.com/stretchr/testify/assert"
  11. )
  12. func TestVersion(t *testing.T) {
  13. prepareTestEnv(t)
  14. setting.AppVer = "test-version-1"
  15. req := NewRequest(t, "GET", "/api/v1/version")
  16. resp := MakeRequest(t, req, http.StatusOK)
  17. var version gitea.ServerVersion
  18. DecodeJSON(t, resp, &version)
  19. assert.Equal(t, setting.AppVer, string(version.Version))
  20. }