diff options
author | Ethan Koenig <etk39@cornell.edu> | 2017-06-18 05:06:17 -0400 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-06-18 17:06:17 +0800 |
commit | 255adc40ae1e0a03547326f143f685be41fa591f (patch) | |
tree | 01959c4c9b8cc62c906205aced21954d0ae90573 /integrations/version_test.go | |
parent | 4df1a240965f6d3f4e3eed2bd4bddceeb9182614 (diff) | |
download | gitea-255adc40ae1e0a03547326f143f685be41fa591f.tar.gz gitea-255adc40ae1e0a03547326f143f685be41fa591f.zip |
Don't show non-comments in comments API (#2001)
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)) } |