summaryrefslogtreecommitdiffstats
path: root/integrations/integration_test.go
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-06-18 05:06:17 -0400
committerLunny Xiao <xiaolunwen@gmail.com>2017-06-18 17:06:17 +0800
commit255adc40ae1e0a03547326f143f685be41fa591f (patch)
tree01959c4c9b8cc62c906205aced21954d0ae90573 /integrations/integration_test.go
parent4df1a240965f6d3f4e3eed2bd4bddceeb9182614 (diff)
downloadgitea-255adc40ae1e0a03547326f143f685be41fa591f.tar.gz
gitea-255adc40ae1e0a03547326f143f685be41fa591f.zip
Don't show non-comments in comments API (#2001)
Diffstat (limited to 'integrations/integration_test.go')
-rw-r--r--integrations/integration_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/integrations/integration_test.go b/integrations/integration_test.go
index 4594443647..e935d36f19 100644
--- a/integrations/integration_test.go
+++ b/integrations/integration_test.go
@@ -252,3 +252,8 @@ func MakeRequest(req *http.Request) *TestResponse {
Headers: respWriter.Headers,
}
}
+
+func DecodeJSON(t testing.TB, resp *TestResponse, v interface{}) {
+ decoder := json.NewDecoder(bytes.NewBuffer(resp.Body))
+ assert.NoError(t, decoder.Decode(v))
+}