[#1304] Moved all non-mutes / non-blocks fields from User.Info to User. WIP.

This commit is contained in:
Ivan Tashkinov 2019-10-16 21:59:21 +03:00
commit 10ff01acd9
88 changed files with 1069 additions and 1170 deletions

View file

@ -136,7 +136,7 @@ defmodule Pleroma.NotificationTest do
test "it disables notifications from followers" do
follower = insert(:user)
followed = insert(:user, info: %{notification_settings: %{"followers" => false}})
followed = insert(:user, notification_settings: %{"followers" => false})
User.follow(follower, followed)
{:ok, activity} = CommonAPI.post(follower, %{"status" => "hey @#{followed.nickname}"})
refute Notification.create_notification(activity, followed)
@ -144,13 +144,13 @@ defmodule Pleroma.NotificationTest do
test "it disables notifications from non-followers" do
follower = insert(:user)
followed = insert(:user, info: %{notification_settings: %{"non_followers" => false}})
followed = insert(:user, notification_settings: %{"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, info: %{notification_settings: %{"follows" => false}})
follower = insert(:user, notification_settings: %{"follows" => false})
followed = insert(:user)
User.follow(follower, followed)
follower = Repo.get(User, follower.id)
@ -159,7 +159,7 @@ defmodule Pleroma.NotificationTest do
end
test "it disables notifications from people the user does not follow" do
follower = insert(:user, info: %{notification_settings: %{"non_follows" => false}})
follower = insert(:user, notification_settings: %{"non_follows" => false})
followed = insert(:user)
{:ok, activity} = CommonAPI.post(followed, %{"status" => "hey @#{follower.nickname}"})
refute Notification.create_notification(activity, follower)