diff options
| author | dcc <dcc@logografos.com> | 2023-09-04 02:54:35 -0700 |
|---|---|---|
| committer | dcc <dcc@logografos.com> | 2023-09-04 02:54:35 -0700 |
| commit | a127041c8b3e31c9fa487dd5ca4faa29a0a59e6e (patch) | |
| tree | 563a301e6dfc8e419a787542f233976a5b761160 /test/pleroma/web/common_api_test.exs | |
| parent | 40bfe7919694619570c3e2192dff895c78ce44b9 (diff) | |
| download | anni-a127041c8b3e31c9fa487dd5ca4faa29a0a59e6e.tar.gz anni-a127041c8b3e31c9fa487dd5ca4faa29a0a59e6e.tar.bz2 anni-a127041c8b3e31c9fa487dd5ca4faa29a0a59e6e.zip | |
move to 2.5.5
Diffstat (limited to 'test/pleroma/web/common_api_test.exs')
| -rwxr-xr-x[-rw-r--r--] | test/pleroma/web/common_api_test.exs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/pleroma/web/common_api_test.exs b/test/pleroma/web/common_api_test.exs index 5c9103e..e606919 100644..100755 --- a/test/pleroma/web/common_api_test.exs +++ b/test/pleroma/web/common_api_test.exs @@ -279,6 +279,24 @@ defmodule Pleroma.Web.CommonAPITest do assert {:reject, "[KeywordPolicy] Matches with rejected keyword"} == CommonAPI.post_chat_message(author, recipient, "GNO/Linux") end + + test "it reject messages with attachments not belonging to user" do + author = insert(:user) + not_author = insert(:user) + recipient = author + + attachment = insert(:attachment, %{user: not_author}) + + {:error, message} = + CommonAPI.post_chat_message( + author, + recipient, + "123", + media_id: attachment.id + ) + + assert message == :forbidden + end end describe "unblocking" do |
