1
0
Fork 0
forked from forgejo/forgejo

Don't show non-comments in comments API (#2001)

This commit is contained in:
Ethan Koenig 2017-06-18 05:06:17 -04:00 committed by Lunny Xiao
parent 4df1a24096
commit 255adc40ae
5 changed files with 49 additions and 10 deletions

View file

@ -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))
}