diff options
| author | Mark Felder <feld@FreeBSD.org> | 2020-09-10 16:02:11 -0500 |
|---|---|---|
| committer | Mark Felder <feld@FreeBSD.org> | 2020-09-10 16:05:22 -0500 |
| commit | 55562ca9362d66553ea3638c91174bbeb6c637f1 (patch) | |
| tree | bb0b57d0a40dec779b0bfbfcbf65f3b9d3bea2b3 /test/web/streamer | |
| parent | 39f7fc5b8ef781c98136d1f9be50a14bff394233 (diff) | |
| parent | 6316350918d1f55167fa384d55f385ff2c93e6bb (diff) | |
| download | pleroma-55562ca9362d66553ea3638c91174bbeb6c637f1.tar.gz pleroma-55562ca9362d66553ea3638c91174bbeb6c637f1.zip | |
Merge branch 'develop' into feature/gen-magic
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) |
