summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2024-05-26 15:13:59 -0400
committerMark Felder <feld@feld.me>2024-05-26 15:14:48 -0400
commitd4769b076a95ce2281dba5673c410eb098445bba (patch)
tree1053362f3a17466d13740f88cc37ea1e609870f1 /test
parent895eea5c752212cb36fb6c908456cdd2f72ad2b7 (diff)
downloadpleroma-d4769b076a95ce2281dba5673c410eb098445bba.tar.gz
pleroma-d4769b076a95ce2281dba5673c410eb098445bba.zip
Return a 422 when trying to reply to a deleted status
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/mastodon_api/controllers/status_controller_test.exs10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
index 80c1ed099..f34911e5b 100644
--- a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
+++ b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
@@ -235,6 +235,16 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
assert Activity.get_in_reply_to_activity(activity).id == replied_to.id
end
+ test "replying to a deleted status", %{user: user, conn: conn} do
+ {:ok, status} = CommonAPI.post(user, %{status: "cofe"})
+ {:ok, _deleted_status} = CommonAPI.delete(status.id, user)
+
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/v1/statuses", %{"status" => "xD", "in_reply_to_id" => status.id})
+ |> json_response_and_validate_schema(422)
+ end
+
test "replying to a direct message with visibility other than direct", %{
user: user,
conn: conn