diff options
| author | eugenijm <eugenijm@protonmail.com> | 2019-10-17 15:25:15 +0300 |
|---|---|---|
| committer | eugenijm <eugenijm@protonmail.com> | 2019-10-17 16:49:39 +0300 |
| commit | 359dd1890e6afcf80584021eaa2421336614dd07 (patch) | |
| tree | fd418b37d3d0ef4980f4f9b6d354e3724b946d56 /test/web/activity_pub/activity_pub_test.exs | |
| parent | 1bfdf57fc777abf210c823bed284f69c0e27ce6d (diff) | |
| download | pleroma-359dd1890e6afcf80584021eaa2421336614dd07.tar.gz pleroma-359dd1890e6afcf80584021eaa2421336614dd07.zip | |
Mastodon API: Mark the conversation as read for the author when they send a new direct message
Diffstat (limited to 'test/web/activity_pub/activity_pub_test.exs')
| -rw-r--r-- | test/web/activity_pub/activity_pub_test.exs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/web/activity_pub/activity_pub_test.exs b/test/web/activity_pub/activity_pub_test.exs index 3a5a2f984..28a9b773c 100644 --- a/test/web/activity_pub/activity_pub_test.exs +++ b/test/web/activity_pub/activity_pub_test.exs @@ -41,6 +41,27 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do assert called(Pleroma.Web.Streamer.stream("participation", participations)) end end + + test "streams them out on activity creation" do + user_one = insert(:user) + user_two = insert(:user) + + with_mock Pleroma.Web.Streamer, + stream: fn _, _ -> nil end do + {:ok, activity} = + CommonAPI.post(user_one, %{ + "status" => "@#{user_two.nickname}", + "visibility" => "direct" + }) + + conversation = + activity.data["context"] + |> Pleroma.Conversation.get_for_ap_id() + |> Repo.preload(participations: :user) + + assert called(Pleroma.Web.Streamer.stream("participation", conversation.participations)) + end + end end describe "fetching restricted by visibility" do |
