diff options
author | lain <lain@soykaf.club> | 2020-07-06 12:15:59 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-07-06 12:15:59 +0200 |
commit | 1963e143c5feace9eb9a3be29b0eeba2ad88751a (patch) | |
tree | 9a7ae160dd452db000e33af62f61057667c5953f /test/web/streamer | |
parent | 67d92ac7b7b977debac8f8e580db1f0e1ef3ed52 (diff) | |
parent | 69f0b286f7b3e0518ac7ae54dfb06539dc179698 (diff) | |
download | pleroma-1963e143c5feace9eb9a3be29b0eeba2ad88751a.tar.gz pleroma-1963e143c5feace9eb9a3be29b0eeba2ad88751a.zip |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remove-twitter-api
Diffstat (limited to 'test/web/streamer')
-rw-r--r-- | test/web/streamer/streamer_test.exs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/web/streamer/streamer_test.exs b/test/web/streamer/streamer_test.exs index 245f6e63f..d56d74464 100644 --- a/test/web/streamer/streamer_test.exs +++ b/test/web/streamer/streamer_test.exs @@ -116,6 +116,35 @@ defmodule Pleroma.Web.StreamerTest do refute Streamer.filtered_by_user?(user, announce) end + test "it does not stream announces of the user's own posts in the 'user' stream", %{ + user: user + } do + Streamer.get_topic_and_add_socket("user", user) + + other_user = insert(:user) + {:ok, activity} = CommonAPI.post(user, %{status: "hey"}) + {:ok, announce} = CommonAPI.repeat(activity.id, other_user) + + assert Streamer.filtered_by_user?(user, announce) + end + + test "it does stream notifications announces of the user's own posts in the 'user' stream", %{ + user: user + } do + Streamer.get_topic_and_add_socket("user", user) + + other_user = insert(:user) + {:ok, activity} = CommonAPI.post(user, %{status: "hey"}) + {:ok, announce} = CommonAPI.repeat(activity.id, other_user) + + notification = + Pleroma.Notification + |> Repo.get_by(%{user_id: user.id, activity_id: announce.id}) + |> Repo.preload(:activity) + + refute Streamer.filtered_by_user?(user, notification) + end + test "it streams boosts of mastodon user in the 'user' stream", %{user: user} do Streamer.get_topic_and_add_socket("user", user) |