diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2019-05-16 17:54:24 +0700 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2019-05-16 17:54:24 +0700 |
commit | fc7246d7159a97a8b9bb878e848db6f8ac0df988 (patch) | |
tree | 7d03e1bc53e376eb21c68a8b543cb06de246d4b7 /test/web/common_api | |
parent | a7a8f3bc2c3bb748f060812751a88873401354dd (diff) | |
parent | a2771869a3b9851edea4961314c7944f3823f754 (diff) | |
download | pleroma-fc7246d7159a97a8b9bb878e848db6f8ac0df988.tar.gz |
Merge remote-tracking branch 'pleroma/develop' into feature/addressable-lists
Diffstat (limited to 'test/web/common_api')
-rw-r--r-- | test/web/common_api/common_api_test.exs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index 11f3c8357..23e89d685 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -88,6 +88,28 @@ defmodule Pleroma.Web.CommonAPITest do assert object.data["content"] == "<p><b>2hu</b></p>alert('xss')" end + test "it does not allow replies to direct messages that are not direct messages themselves" do + user = insert(:user) + + {:ok, activity} = CommonAPI.post(user, %{"status" => "suya..", "visibility" => "direct"}) + + assert {:ok, _} = + CommonAPI.post(user, %{ + "status" => "suya..", + "visibility" => "direct", + "in_reply_to_status_id" => activity.id + }) + + Enum.each(["public", "private", "unlisted"], fn visibility -> + assert {:error, {:private_to_public, _}} = + CommonAPI.post(user, %{ + "status" => "suya..", + "visibility" => visibility, + "in_reply_to_status_id" => activity.id + }) + end) + end + test "it allows to address a list" do user = insert(:user) {:ok, list} = Pleroma.List.create("foo", user) |