diff options
author | 2023-11-08 14:32:17 +0000 | |
---|---|---|
committer | 2023-11-08 14:32:17 +0000 | |
commit | e9e5dc5a40926e5320cb131b035c46b1e1b0bd59 (patch) | |
tree | 52edc9fa5742f28e1e5223f51cda628ec1c35a24 /internal/api/client | |
parent | [chore]: Bump github.com/spf13/cobra from 1.7.0 to 1.8.0 (#2338) (diff) | |
download | gotosocial-e9e5dc5a40926e5320cb131b035c46b1e1b0bd59.tar.xz |
[feature] add support for polls + receiving federated status edits (#2330)
Diffstat (limited to 'internal/api/client')
-rw-r--r-- | internal/api/client/accounts/accountverify_test.go | 2 | ||||
-rw-r--r-- | internal/api/client/admin/reportsget_test.go | 44 | ||||
-rw-r--r-- | internal/api/client/instance/instancepatch_test.go | 12 | ||||
-rw-r--r-- | internal/api/client/polls/polls.go | 48 | ||||
-rw-r--r-- | internal/api/client/polls/polls_get.go | 100 | ||||
-rw-r--r-- | internal/api/client/polls/polls_vote.go | 112 | ||||
-rw-r--r-- | internal/api/client/reports/reportget_test.go | 4 | ||||
-rw-r--r-- | internal/api/client/reports/reportsget_test.go | 16 | ||||
-rw-r--r-- | internal/api/client/search/searchget_test.go | 6 | ||||
-rw-r--r-- | internal/api/client/statuses/statuscreate.go | 9 | ||||
-rw-r--r-- | internal/api/client/statuses/statusmute_test.go | 8 | ||||
-rw-r--r-- | internal/api/client/statuses/statusunpin_test.go | 2 |
12 files changed, 314 insertions, 49 deletions
diff --git a/internal/api/client/accounts/accountverify_test.go b/internal/api/client/accounts/accountverify_test.go index 1690a0271..7827cc732 100644 --- a/internal/api/client/accounts/accountverify_test.go +++ b/internal/api/client/accounts/accountverify_test.go @@ -79,7 +79,7 @@ func (suite *AccountVerifyTestSuite) TestAccountVerifyGet() { suite.Equal("http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/header/small/01PFPMWK2FF0D9WMHEJHR07C3Q.jpg", apimodelAccount.HeaderStatic) suite.Equal(2, apimodelAccount.FollowersCount) suite.Equal(2, apimodelAccount.FollowingCount) - suite.Equal(5, apimodelAccount.StatusesCount) + suite.Equal(6, apimodelAccount.StatusesCount) suite.EqualValues(gtsmodel.VisibilityPublic, apimodelAccount.Source.Privacy) suite.Equal(testAccount.Language, apimodelAccount.Source.Language) suite.Equal(testAccount.NoteRaw, apimodelAccount.Source.Note) diff --git a/internal/api/client/admin/reportsget_test.go b/internal/api/client/admin/reportsget_test.go index 4c714a9e0..ecef1d465 100644 --- a/internal/api/client/admin/reportsget_test.go +++ b/internal/api/client/admin/reportsget_test.go @@ -180,8 +180,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetAll() { "header_static": "http://localhost:8080/assets/default_header.png", "followers_count": 0, "following_count": 0, - "statuses_count": 1, - "last_status_at": "2021-09-20T10:40:37.000Z", + "statuses_count": 2, + "last_status_at": "2021-09-11T09:40:37.000Z", "emojis": [], "fields": [] } @@ -221,8 +221,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetAll() { "header_static": "http://localhost:8080/assets/default_header.png", "followers_count": 1, "following_count": 1, - "statuses_count": 7, - "last_status_at": "2021-10-20T10:40:37.000Z", + "statuses_count": 8, + "last_status_at": "2021-07-28T08:40:37.000Z", "emojis": [], "fields": [ { @@ -382,8 +382,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetAll() { "header_static": "http://localhost:8080/assets/default_header.png", "followers_count": 1, "following_count": 1, - "statuses_count": 7, - "last_status_at": "2021-10-20T10:40:37.000Z", + "statuses_count": 8, + "last_status_at": "2021-07-28T08:40:37.000Z", "emojis": [], "fields": [ { @@ -438,8 +438,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetAll() { "header_static": "http://localhost:8080/assets/default_header.png", "followers_count": 0, "following_count": 0, - "statuses_count": 1, - "last_status_at": "2021-09-20T10:40:37.000Z", + "statuses_count": 2, + "last_status_at": "2021-09-11T09:40:37.000Z", "emojis": [], "fields": [] } @@ -485,8 +485,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetAll() { "header_static": "http://localhost:8080/assets/default_header.png", "followers_count": 0, "following_count": 0, - "statuses_count": 1, - "last_status_at": "2021-09-20T10:40:37.000Z", + "statuses_count": 2, + "last_status_at": "2021-09-11T09:40:37.000Z", "emojis": [], "fields": [] }, @@ -603,8 +603,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetCreatedByAccount() { "header_static": "http://localhost:8080/assets/default_header.png", "followers_count": 1, "following_count": 1, - "statuses_count": 7, - "last_status_at": "2021-10-20T10:40:37.000Z", + "statuses_count": 8, + "last_status_at": "2021-07-28T08:40:37.000Z", "emojis": [], "fields": [ { @@ -659,8 +659,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetCreatedByAccount() { "header_static": "http://localhost:8080/assets/default_header.png", "followers_count": 0, "following_count": 0, - "statuses_count": 1, - "last_status_at": "2021-09-20T10:40:37.000Z", + "statuses_count": 2, + "last_status_at": "2021-09-11T09:40:37.000Z", "emojis": [], "fields": [] } @@ -706,8 +706,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetCreatedByAccount() { "header_static": "http://localhost:8080/assets/default_header.png", "followers_count": 0, "following_count": 0, - "statuses_count": 1, - "last_status_at": "2021-09-20T10:40:37.000Z", + "statuses_count": 2, + "last_status_at": "2021-09-11T09:40:37.000Z", "emojis": [], "fields": [] }, @@ -824,8 +824,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetTargetAccount() { "header_static": "http://localhost:8080/assets/default_header.png", "followers_count": 1, "following_count": 1, - "statuses_count": 7, - "last_status_at": "2021-10-20T10:40:37.000Z", + "statuses_count": 8, + "last_status_at": "2021-07-28T08:40:37.000Z", "emojis": [], "fields": [ { @@ -880,8 +880,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetTargetAccount() { "header_static": "http://localhost:8080/assets/default_header.png", "followers_count": 0, "following_count": 0, - "statuses_count": 1, - "last_status_at": "2021-09-20T10:40:37.000Z", + "statuses_count": 2, + "last_status_at": "2021-09-11T09:40:37.000Z", "emojis": [], "fields": [] } @@ -927,8 +927,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetTargetAccount() { "header_static": "http://localhost:8080/assets/default_header.png", "followers_count": 0, "following_count": 0, - "statuses_count": 1, - "last_status_at": "2021-09-20T10:40:37.000Z", + "statuses_count": 2, + "last_status_at": "2021-09-11T09:40:37.000Z", "emojis": [], "fields": [] }, diff --git a/internal/api/client/instance/instancepatch_test.go b/internal/api/client/instance/instancepatch_test.go index a402f8347..2af226357 100644 --- a/internal/api/client/instance/instancepatch_test.go +++ b/internal/api/client/instance/instancepatch_test.go @@ -130,7 +130,7 @@ func (suite *InstancePatchTestSuite) TestInstancePatch1() { }, "stats": { "domain_count": 2, - "status_count": 16, + "status_count": 18, "user_count": 4 }, "thumbnail": "http://localhost:8080/assets/logo.png", @@ -244,7 +244,7 @@ func (suite *InstancePatchTestSuite) TestInstancePatch2() { }, "stats": { "domain_count": 2, - "status_count": 16, + "status_count": 18, "user_count": 4 }, "thumbnail": "http://localhost:8080/assets/logo.png", @@ -358,7 +358,7 @@ func (suite *InstancePatchTestSuite) TestInstancePatch3() { }, "stats": { "domain_count": 2, - "status_count": 16, + "status_count": 18, "user_count": 4 }, "thumbnail": "http://localhost:8080/assets/logo.png", @@ -523,7 +523,7 @@ func (suite *InstancePatchTestSuite) TestInstancePatch6() { }, "stats": { "domain_count": 2, - "status_count": 16, + "status_count": 18, "user_count": 4 }, "thumbnail": "http://localhost:8080/assets/logo.png", @@ -659,7 +659,7 @@ func (suite *InstancePatchTestSuite) TestInstancePatch8() { }, "stats": { "domain_count": 2, - "status_count": 16, + "status_count": 18, "user_count": 4 }, "thumbnail": "http://localhost:8080/fileserver/01AY6P665V14JJR0AFVRT7311Y/attachment/original/`+instanceAccount.AvatarMediaAttachment.ID+`.gif",`+` @@ -810,7 +810,7 @@ func (suite *InstancePatchTestSuite) TestInstancePatch9() { }, "stats": { "domain_count": 2, - "status_count": 16, + "status_count": 18, "user_count": 4 }, "thumbnail": "http://localhost:8080/assets/logo.png", diff --git a/internal/api/client/polls/polls.go b/internal/api/client/polls/polls.go new file mode 100644 index 000000000..a2c176449 --- /dev/null +++ b/internal/api/client/polls/polls.go @@ -0,0 +1,48 @@ +// GoToSocial +// Copyright (C) GoToSocial Authors admin@gotosocial.org +// SPDX-License-Identifier: AGPL-3.0-or-later +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + +package polls + +import ( + "net/http" + + "github.com/gin-gonic/gin" + "github.com/superseriousbusiness/gotosocial/internal/api/util" + "github.com/superseriousbusiness/gotosocial/internal/processing" +) + +const ( + IDKey = "id" // IDKey is the key for poll IDs + BasePath = "/:" + util.APIVersionKey + "/polls" // BasePath is the base API path for making poll requests through v1 or v2 of the api (for mastodon API compatibility) + PollWithID = BasePath + "/:" + IDKey // + PollVotesWithID = BasePath + "/:" + IDKey + "/votes" // +) + +type Module struct { + processor *processing.Processor +} + +func New(processor *processing.Processor) *Module { + return &Module{ + processor: processor, + } +} + +func (m *Module) Route(attachHandler func(method string, path string, f ...gin.HandlerFunc) gin.IRoutes) { + attachHandler(http.MethodGet, PollWithID, m.PollGETHandler) + attachHandler(http.MethodPost, PollVotesWithID, m.PollVotePOSTHandler) +} diff --git a/internal/api/client/polls/polls_get.go b/internal/api/client/polls/polls_get.go new file mode 100644 index 000000000..0b15c0ed1 --- /dev/null +++ b/internal/api/client/polls/polls_get.go @@ -0,0 +1,100 @@ +// GoToSocial +// Copyright (C) GoToSocial Authors admin@gotosocial.org +// SPDX-License-Identifier: AGPL-3.0-or-later +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + +package polls + +import ( + "net/http" + + "github.com/gin-gonic/gin" + apiutil "github.com/superseriousbusiness/gotosocial/internal/api/util" + "github.com/superseriousbusiness/gotosocial/internal/gtserror" + "github.com/superseriousbusiness/gotosocial/internal/oauth" +) + +// PollGETHandler swagger:operation GET /api/v1/polls/{id} poll +// +// View poll with given ID. +// +// --- +// tags: +// - polls +// +// produces: +// - application/json +// +// parameters: +// - +// name: id +// type: string +// description: Target poll ID. +// in: path +// required: true +// +// security: +// - OAuth2 Bearer: +// - read:statuses +// +// responses: +// '200': +// description: "The requested poll." +// schema: +// "$ref": "#/definitions/poll" +// '400': +// description: bad request +// '401': +// description: unauthorized +// '403': +// description: forbidden +// '404': +// description: not found +// '406': +// description: not acceptable +// '500': +// description: internal server error +func (m *Module) PollGETHandler(c *gin.Context) { + authed, err := oauth.Authed(c, true, true, true, true) + if err != nil { + errWithCode := gtserror.NewErrorUnauthorized(err, err.Error()) + apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) + return + } + + if _, err := apiutil.NegotiateAccept(c, apiutil.JSONAcceptHeaders...); err != nil { + errWithCode := gtserror.NewErrorNotAcceptable(err, err.Error()) + apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) + return + } + + pollID, errWithCode := apiutil.ParseID(c.Param(IDKey)) + if errWithCode != nil { + apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) + return + } + + poll, errWithCode := m.processor.Polls().PollGet( + c.Request.Context(), + authed.Account, + pollID, + ) + if errWithCode != nil { + apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) + return + } + + c.JSON(http.StatusOK, poll) +} diff --git a/internal/api/client/polls/polls_vote.go b/internal/api/client/polls/polls_vote.go new file mode 100644 index 000000000..8773d0606 --- /dev/null +++ b/internal/api/client/polls/polls_vote.go @@ -0,0 +1,112 @@ +// GoToSocial +// Copyright (C) GoToSocial Authors admin@gotosocial.org +// SPDX-License-Identifier: AGPL-3.0-or-later +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + +package polls + +import ( + "net/http" + + "github.com/gin-gonic/gin" + apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model" + apiutil "github.com/superseriousbusiness/gotosocial/internal/api/util" + "github.com/superseriousbusiness/gotosocial/internal/gtserror" + "github.com/superseriousbusiness/gotosocial/internal/oauth" +) + +// PollVotePOSTHandler swagger:operation POST /api/v1/polls/{id}/vote poll +// +// Vote with choices in the given poll. +// +// --- +// tags: +// - polls +// +// produces: +// - application/json +// +// parameters: +// - +// name: id +// type: string +// description: Target poll ID. +// in: path +// required: true +// +// security: +// - OAuth2 Bearer: +// - write:statuses +// +// responses: +// '200': +// description: "The updated poll with user vote choices." +// schema: +// "$ref": "#/definitions/poll" +// '400': +// description: bad request +// '401': +// description: unauthorized +// '403': +// description: forbidden +// '404': +// description: not found +// '406': +// description: not acceptable +// '422': +// description: unprocessable entity +// '500': +// description: internal server error +func (m *Module) PollVotePOSTHandler(c *gin.Context) { + authed, err := oauth.Authed(c, true, true, true, true) + if err != nil { + errWithCode := gtserror.NewErrorUnauthorized(err, err.Error()) + apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) + return + } + + if _, err := apiutil.NegotiateAccept(c, apiutil.JSONAcceptHeaders...); err != nil { + errWithCode := gtserror.NewErrorNotAcceptable(err, err.Error()) + apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) + return + } + + pollID, errWithCode := apiutil.ParseID(c.Param(IDKey)) + if errWithCode != nil { + apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) + return + } + + var form apimodel.PollVoteRequest + + if err := c.ShouldBind(&form); err != nil { + errWithCode := gtserror.NewErrorBadRequest(err, err.Error()) + apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) + return + } + + poll, errWithCode := m.processor.Polls().PollVote( + c.Request.Context(), + authed.Account, + pollID, + form.Choices, + ) + if errWithCode != nil { + apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) + return + } + + c.JSON(http.StatusOK, poll) +} diff --git a/internal/api/client/reports/reportget_test.go b/internal/api/client/reports/reportget_test.go index 1bdb7557c..bc9fcaa7b 100644 --- a/internal/api/client/reports/reportget_test.go +++ b/internal/api/client/reports/reportget_test.go @@ -129,8 +129,8 @@ func (suite *ReportGetTestSuite) TestGetReport1() { "header_static": "http://localhost:8080/assets/default_header.png", "followers_count": 0, "following_count": 0, - "statuses_count": 1, - "last_status_at": "2021-09-20T10:40:37.000Z", + "statuses_count": 2, + "last_status_at": "2021-09-11T09:40:37.000Z", "emojis": [], "fields": [] } diff --git a/internal/api/client/reports/reportsget_test.go b/internal/api/client/reports/reportsget_test.go index e58a622db..64e79ea00 100644 --- a/internal/api/client/reports/reportsget_test.go +++ b/internal/api/client/reports/reportsget_test.go @@ -154,8 +154,8 @@ func (suite *ReportsGetTestSuite) TestGetReports() { "header_static": "http://localhost:8080/assets/default_header.png", "followers_count": 0, "following_count": 0, - "statuses_count": 1, - "last_status_at": "2021-09-20T10:40:37.000Z", + "statuses_count": 2, + "last_status_at": "2021-09-11T09:40:37.000Z", "emojis": [], "fields": [] } @@ -244,8 +244,8 @@ func (suite *ReportsGetTestSuite) TestGetReports4() { "header_static": "http://localhost:8080/assets/default_header.png", "followers_count": 0, "following_count": 0, - "statuses_count": 1, - "last_status_at": "2021-09-20T10:40:37.000Z", + "statuses_count": 2, + "last_status_at": "2021-09-11T09:40:37.000Z", "emojis": [], "fields": [] } @@ -318,8 +318,8 @@ func (suite *ReportsGetTestSuite) TestGetReports6() { "header_static": "http://localhost:8080/assets/default_header.png", "followers_count": 0, "following_count": 0, - "statuses_count": 1, - "last_status_at": "2021-09-20T10:40:37.000Z", + "statuses_count": 2, + "last_status_at": "2021-09-11T09:40:37.000Z", "emojis": [], "fields": [] } @@ -376,8 +376,8 @@ func (suite *ReportsGetTestSuite) TestGetReports7() { "header_static": "http://localhost:8080/assets/default_header.png", "followers_count": 0, "following_count": 0, - "statuses_count": 1, - "last_status_at": "2021-09-20T10:40:37.000Z", + "statuses_count": 2, + "last_status_at": "2021-09-11T09:40:37.000Z", "emojis": [], "fields": [] } diff --git a/internal/api/client/search/searchget_test.go b/internal/api/client/search/searchget_test.go index 2670fff92..307b928bd 100644 --- a/internal/api/client/search/searchget_test.go +++ b/internal/api/client/search/searchget_test.go @@ -877,7 +877,7 @@ func (suite *SearchGetTestSuite) TestSearchAAny() { } suite.Len(searchResult.Accounts, 5) - suite.Len(searchResult.Statuses, 4) + suite.Len(searchResult.Statuses, 5) suite.Len(searchResult.Hashtags, 0) } @@ -918,7 +918,7 @@ func (suite *SearchGetTestSuite) TestSearchAAnyFollowingOnly() { } suite.Len(searchResult.Accounts, 2) - suite.Len(searchResult.Statuses, 4) + suite.Len(searchResult.Statuses, 5) suite.Len(searchResult.Hashtags, 0) } @@ -959,7 +959,7 @@ func (suite *SearchGetTestSuite) TestSearchAStatuses() { } suite.Len(searchResult.Accounts, 0) - suite.Len(searchResult.Statuses, 4) + suite.Len(searchResult.Statuses, 5) suite.Len(searchResult.Hashtags, 0) } diff --git a/internal/api/client/statuses/statuscreate.go b/internal/api/client/statuses/statuscreate.go index e8378f461..5034e53b1 100644 --- a/internal/api/client/statuses/statuscreate.go +++ b/internal/api/client/statuses/statuscreate.go @@ -103,7 +103,12 @@ func (m *Module) StatusCreatePOSTHandler(c *gin.Context) { return } - apiStatus, errWithCode := m.processor.Status().Create(c.Request.Context(), authed.Account, authed.Application, form) + apiStatus, errWithCode := m.processor.Status().Create( + c.Request.Context(), + authed.Account, + authed.Application, + form, + ) if errWithCode != nil { apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) return @@ -144,7 +149,7 @@ func validateNormalizeCreateStatus(form *apimodel.AdvancedStatusCreateForm) erro } if form.Poll != nil { - if form.Poll.Options == nil { + if len(form.Poll.Options) == 0 { return errors.New("poll with no options") } if len(form.Poll.Options) > maxPollOptions { diff --git a/internal/api/client/statuses/statusmute_test.go b/internal/api/client/statuses/statusmute_test.go index e642fb308..91a361bd6 100644 --- a/internal/api/client/statuses/statusmute_test.go +++ b/internal/api/client/statuses/statusmute_test.go @@ -130,8 +130,8 @@ func (suite *StatusMuteTestSuite) TestMuteUnmuteStatus() { "header_static": "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/header/small/01PFPMWK2FF0D9WMHEJHR07C3Q.jpg", "followers_count": 2, "following_count": 2, - "statuses_count": 5, - "last_status_at": "2022-05-20T11:37:55.000Z", + "statuses_count": 6, + "last_status_at": "2022-05-20T11:41:10.000Z", "emojis": [], "fields": [], "enable_rss": true, @@ -193,8 +193,8 @@ func (suite *StatusMuteTestSuite) TestMuteUnmuteStatus() { "header_static": "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/header/small/01PFPMWK2FF0D9WMHEJHR07C3Q.jpg", "followers_count": 2, "following_count": 2, - "statuses_count": 5, - "last_status_at": "2022-05-20T11:37:55.000Z", + "statuses_count": 6, + "last_status_at": "2022-05-20T11:41:10.000Z", "emojis": [], "fields": [], "enable_rss": true, diff --git a/internal/api/client/statuses/statusunpin_test.go b/internal/api/client/statuses/statusunpin_test.go index 9f6602b98..14253f804 100644 --- a/internal/api/client/statuses/statusunpin_test.go +++ b/internal/api/client/statuses/statusunpin_test.go @@ -107,7 +107,7 @@ func (suite *StatusUnpinTestSuite) TestUnpinStatusNotFound() { // Unpin a pinned followers-only status owned by another account. targetStatus := suite.testStatuses["local_account_2_status_7"] - if _, err := suite.createUnpin(http.StatusNotFound, `{"error":"Not Found"}`, targetStatus.ID); err != nil { + if _, err := suite.createUnpin(http.StatusNotFound, `{"error":"Not Found: target status not found"}`, targetStatus.ID); err != nil { suite.FailNow(err.Error()) } } |