aboutsummaryrefslogtreecommitdiff
path: root/test/notification_test.exs
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2019-12-09 19:41:43 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2019-12-09 19:41:43 +0300
commit2b821036c4bd84cee51c9fcace5a4b3764c3bba1 (patch)
tree811d75ef4b0442f3f2102d873fab4e10c777e7f1 /test/notification_test.exs
parent5876a9cb79e53f932d63e457610852031669a222 (diff)
parent0d2c13a119302d0d217a7cb61c28a01c620b1b61 (diff)
downloadpleroma-2b821036c4bd84cee51c9fcace5a4b3764c3bba1.tar.gz
Merge branch 'develop' into issue/1383
Diffstat (limited to 'test/notification_test.exs')
-rw-r--r--test/notification_test.exs20
1 files changed, 16 insertions, 4 deletions
diff --git a/test/notification_test.exs b/test/notification_test.exs
index 827ac4f06..ffa3d4b8c 100644
--- a/test/notification_test.exs
+++ b/test/notification_test.exs
@@ -136,7 +136,10 @@ defmodule Pleroma.NotificationTest do
test "it disables notifications from followers" do
follower = insert(:user)
- followed = insert(:user, notification_settings: %{"followers" => false})
+
+ followed =
+ insert(:user, notification_settings: %Pleroma.User.NotificationSetting{followers: false})
+
User.follow(follower, followed)
{:ok, activity} = CommonAPI.post(follower, %{"status" => "hey @#{followed.nickname}"})
refute Notification.create_notification(activity, followed)
@@ -144,13 +147,20 @@ defmodule Pleroma.NotificationTest do
test "it disables notifications from non-followers" do
follower = insert(:user)
- followed = insert(:user, notification_settings: %{"non_followers" => false})
+
+ followed =
+ insert(:user,
+ notification_settings: %Pleroma.User.NotificationSetting{non_followers: false}
+ )
+
{:ok, activity} = CommonAPI.post(follower, %{"status" => "hey @#{followed.nickname}"})
refute Notification.create_notification(activity, followed)
end
test "it disables notifications from people the user follows" do
- follower = insert(:user, notification_settings: %{"follows" => false})
+ follower =
+ insert(:user, notification_settings: %Pleroma.User.NotificationSetting{follows: false})
+
followed = insert(:user)
User.follow(follower, followed)
follower = Repo.get(User, follower.id)
@@ -159,7 +169,9 @@ defmodule Pleroma.NotificationTest do
end
test "it disables notifications from people the user does not follow" do
- follower = insert(:user, notification_settings: %{"non_follows" => false})
+ follower =
+ insert(:user, notification_settings: %Pleroma.User.NotificationSetting{non_follows: false})
+
followed = insert(:user)
{:ok, activity} = CommonAPI.post(followed, %{"status" => "hey @#{follower.nickname}"})
refute Notification.create_notification(activity, follower)