From d487a765721a4fda0362af92bb047c0e34936284 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Fri, 10 Jun 2022 11:19:23 -0500 Subject: [PATCH] Correctly decode JSON in api_activitypub_person_test.go --- integrations/api_activitypub_person_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/integrations/api_activitypub_person_test.go b/integrations/api_activitypub_person_test.go index c7c4be5ee6..c158fbc256 100644 --- a/integrations/api_activitypub_person_test.go +++ b/integrations/api_activitypub_person_test.go @@ -30,12 +30,13 @@ func TestActivityPubPerson(t *testing.T) { username := "user2" req := NewRequestf(t, "GET", fmt.Sprintf("/api/v1/activitypub/user/%s", username)) resp := MakeRequest(t, req, http.StatusOK) - assert.Contains(t, resp.Body.String(), "@context") + body := resp.Body.Bytes() + assert.Contains(t, string(body), "@context") var m map[string]interface{} DecodeJSON(t, resp, &m) var person ap.Person - err := person.UnmarshalJSON(resp.Body.Bytes()) + err := person.UnmarshalJSON(body) assert.NoError(t, err) assert.Equal(t, ap.ActivityVocabularyType("Person"), person.Type)