From 18e2f69e85bf7101b9d26c72e7676e4cb0dac285 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sat, 5 Oct 2024 19:14:53 +0200 Subject: [bugfix] Return 501 (not implemented) if user tries to schedule post (#3395) --- internal/api/client/statuses/statuscreate_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'internal/api/client/statuses/statuscreate_test.go') diff --git a/internal/api/client/statuses/statuscreate_test.go b/internal/api/client/statuses/statuscreate_test.go index 8598b5ef0..5f5386dd5 100644 --- a/internal/api/client/statuses/statuscreate_test.go +++ b/internal/api/client/statuses/statuscreate_test.go @@ -365,6 +365,25 @@ func (suite *StatusCreateTestSuite) TestPostNewStatusMessedUpIntPolicy() { }`, out) } +func (suite *StatusCreateTestSuite) TestPostNewScheduledStatus() { + out, recorder := suite.postStatus(map[string][]string{ + "status": {"this is a brand new status! #helloworld"}, + "spoiler_text": {"hello hello"}, + "sensitive": {"true"}, + "visibility": {string(apimodel.VisibilityMutualsOnly)}, + "scheduled_at": {"2080-10-04T15:32:02.018Z"}, + }, "") + + // We should have 501 from + // our call to the function. + suite.Equal(http.StatusNotImplemented, recorder.Code) + + // We should have a helpful error message. + suite.Equal(`{ + "error": "Not Implemented: scheduled_at is not yet implemented" +}`, out) +} + func (suite *StatusCreateTestSuite) TestPostNewStatusMarkdown() { out, recorder := suite.postStatus(map[string][]string{ "status": {statusMarkdown}, -- cgit v1.2.3