aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-10-22 12:22:08 +0200
committerlain <lain@soykaf.club>2020-10-22 12:22:08 +0200
commit8d251096fe71d289cf6a50f3d5638fb43b07c24a (patch)
tree4a7b10347df1be3136c251bd03e96898841082ce /test
parent77e827bb66ca42b11795133563b0d805c843fb56 (diff)
downloadpleroma-8d251096fe71d289cf6a50f3d5638fb43b07c24a.tar.gz
SideEffects: Correctly handle chat messages sent to yourself
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/common_api_test.exs14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/pleroma/web/common_api_test.exs b/test/pleroma/web/common_api_test.exs
index f5d09f396..d8dc90173 100644
--- a/test/pleroma/web/common_api_test.exs
+++ b/test/pleroma/web/common_api_test.exs
@@ -95,6 +95,20 @@ defmodule Pleroma.Web.CommonAPITest do
describe "posting chat messages" do
setup do: clear_config([:instance, :chat_limit])
+ test "it posts a self-chat" do
+ author = insert(:user)
+ recipient = author
+
+ {:ok, activity} =
+ CommonAPI.post_chat_message(
+ author,
+ recipient,
+ "remember to buy milk when milk truk arive"
+ )
+
+ assert activity.data["type"] == "Create"
+ end
+
test "it posts a chat message without content but with an attachment" do
author = insert(:user)
recipient = insert(:user)