diff options
author | lain <lain@soykaf.club> | 2019-05-15 17:47:29 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-05-15 17:47:29 +0200 |
commit | f168a1cbdc318ffaa2d8bc9fb561eb3dfdfb89d9 (patch) | |
tree | 3c208baf52e27859491cce07954ac9b1198cbc8f /test/web/common_api/common_api_test.exs | |
parent | 786f2c7a849bc4fa2bd4aac18de59ef6b2ed18c5 (diff) | |
parent | 62516be9c462ca206163eaf7822f9ee5c2470453 (diff) | |
download | pleroma-f168a1cbdc318ffaa2d8bc9fb561eb3dfdfb89d9.tar.gz pleroma-f168a1cbdc318ffaa2d8bc9fb561eb3dfdfb89d9.zip |
Merge remote-tracking branch 'origin/develop' into conversations-import
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-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 a5b07c446..8d4f401ee 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -87,6 +87,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 end describe "reactions" do |