diff options
| author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-04-11 16:01:09 +0300 | 
|---|---|---|
| committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-04-11 16:01:09 +0300 | 
| commit | 88b16fdfb7b40877aecae5d45f6f3a1c54362f13 (patch) | |
| tree | bb938e9f97e051a8652cc58716202322d993fb20 /test | |
| parent | c682563b92ce0b1a44523b67f5739707dd203de0 (diff) | |
| download | pleroma-88b16fdfb7b40877aecae5d45f6f3a1c54362f13.tar.gz pleroma-88b16fdfb7b40877aecae5d45f6f3a1c54362f13.zip | |
[#1364] Disabled notifications on activities from blocked domains.
Diffstat (limited to 'test')
| -rw-r--r-- | test/notification_test.exs | 15 | 
1 files changed, 15 insertions, 0 deletions
| diff --git a/test/notification_test.exs b/test/notification_test.exs index 837a9dacd..caa941934 100644 --- a/test/notification_test.exs +++ b/test/notification_test.exs @@ -609,6 +609,21 @@ defmodule Pleroma.NotificationTest do        assert [other_user] == disabled_receivers        refute other_user in enabled_receivers      end + +    test "it returns domain-blocking recipient in disabled recipients list" do +      blocked_domain = "blocked.domain" +      user = insert(:user, %{ap_id: "https://#{blocked_domain}/@actor"}) +      other_user = insert(:user) + +      {:ok, other_user} = User.block_domain(other_user, blocked_domain) + +      {:ok, activity} = CommonAPI.post(user, %{"status" => "hey @#{other_user.nickname}!"}) + +      {enabled_receivers, disabled_receivers} = Notification.get_notified_from_activity(activity) + +      assert [] == enabled_receivers +      assert [other_user] == disabled_receivers +    end    end    describe "notification lifecycle" do | 
