diff options
Diffstat (limited to 'integrations/version_test.go')
-rw-r--r-- | integrations/version_test.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/integrations/version_test.go b/integrations/version_test.go index b5902a20a3..2234366b1d 100644 --- a/integrations/version_test.go +++ b/integrations/version_test.go @@ -5,8 +5,6 @@ package integrations import ( - "bytes" - "encoding/json" "net/http" "testing" @@ -22,11 +20,9 @@ func TestVersion(t *testing.T) { setting.AppVer = "1.1.0+dev" req := NewRequest(t, "GET", "/api/v1/version") resp := MakeRequest(req) + assert.EqualValues(t, http.StatusOK, resp.HeaderCode) var version gitea.ServerVersion - decoder := json.NewDecoder(bytes.NewBuffer(resp.Body)) - assert.NoError(t, decoder.Decode(&version)) - - assert.EqualValues(t, http.StatusOK, resp.HeaderCode) + DecodeJSON(t, resp, &version) assert.Equal(t, setting.AppVer, string(version.Version)) } |