diff options
| author | feld <feld@feld.me> | 2019-10-17 20:05:01 +0000 | 
|---|---|---|
| committer | feld <feld@feld.me> | 2019-10-17 20:05:01 +0000 | 
| commit | 6c82b6e3bf42f9897522c0f7ebd101dd01311a46 (patch) | |
| tree | fd418b37d3d0ef4980f4f9b6d354e3724b946d56 /test/web/activity_pub | |
| parent | 1bfdf57fc777abf210c823bed284f69c0e27ce6d (diff) | |
| parent | 359dd1890e6afcf80584021eaa2421336614dd07 (diff) | |
| download | pleroma-6c82b6e3bf42f9897522c0f7ebd101dd01311a46.tar.gz pleroma-6c82b6e3bf42f9897522c0f7ebd101dd01311a46.zip | |
Merge branch 'mark-converstation-as-read-on-new-direct-message' into 'develop'
Mastodon API / Conversations: Mark the conversation as read for the author when they send a new direct message
See merge request pleroma/pleroma!1853
Diffstat (limited to 'test/web/activity_pub')
| -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 | 
