diff options
Diffstat (limited to 'internal/api/client/followrequests/reject_test.go')
-rw-r--r-- | internal/api/client/followrequests/reject_test.go | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/internal/api/client/followrequests/reject_test.go b/internal/api/client/followrequests/reject_test.go index 439d7424f..758cd0448 100644 --- a/internal/api/client/followrequests/reject_test.go +++ b/internal/api/client/followrequests/reject_test.go @@ -19,7 +19,9 @@ package followrequests_test import ( + "bytes" "context" + "encoding/json" "fmt" "io/ioutil" "net/http" @@ -28,7 +30,6 @@ import ( "time" "github.com/gin-gonic/gin" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" "github.com/superseriousbusiness/gotosocial/internal/api/client/followrequests" "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" @@ -77,9 +78,25 @@ func (suite *RejectTestSuite) TestReject() { // check the response b, err := ioutil.ReadAll(result.Body) - assert.NoError(suite.T(), err) - - suite.Equal(`{"id":"01FHMQX3GAABWSM0S2VZEC2SWC","following":false,"showing_reblogs":false,"notifying":false,"followed_by":false,"blocking":false,"blocked_by":false,"muting":false,"muting_notifications":false,"requested":false,"domain_blocking":false,"endorsed":false,"note":""}`, string(b)) + suite.NoError(err) + dst := new(bytes.Buffer) + err = json.Indent(dst, b, "", " ") + suite.NoError(err) + suite.Equal(`{ + "id": "01FHMQX3GAABWSM0S2VZEC2SWC", + "following": false, + "showing_reblogs": false, + "notifying": false, + "followed_by": false, + "blocking": false, + "blocked_by": false, + "muting": false, + "muting_notifications": false, + "requested": false, + "domain_blocking": false, + "endorsed": false, + "note": "" +}`, dst.String()) } func TestRejectTestSuite(t *testing.T) { |