tests: chase remote/local removal

This commit is contained in:
William Pitcock 2019-05-26 00:20:54 +00:00
parent 750ede5764
commit 45e4642a58
3 changed files with 0 additions and 32 deletions

View file

@ -78,33 +78,6 @@ defmodule Pleroma.NotificationTest do
assert nil == Notification.create_notification(activity, muter) assert nil == Notification.create_notification(activity, muter)
end end
test "it disables notifications from people on remote instances" do
user = insert(:user, info: %{notification_settings: %{"remote" => false}})
other_user = insert(:user)
create_activity = %{
"@context" => "https://www.w3.org/ns/activitystreams",
"type" => "Create",
"to" => ["https://www.w3.org/ns/activitystreams#Public"],
"actor" => other_user.ap_id,
"object" => %{
"type" => "Note",
"content" => "Hi @#{user.nickname}",
"attributedTo" => other_user.ap_id
}
}
{:ok, %{local: false} = activity} = Transmogrifier.handle_incoming(create_activity)
assert nil == Notification.create_notification(activity, user)
end
test "it disables notifications from people on the local instance" do
user = insert(:user, info: %{notification_settings: %{"local" => false}})
other_user = insert(:user)
{:ok, activity} = CommonAPI.post(other_user, %{"status" => "hey @#{user.nickname}"})
assert nil == Notification.create_notification(activity, user)
end
test "it disables notifications from followers" do test "it disables notifications from followers" do
follower = insert(:user) follower = insert(:user)
followed = insert(:user, info: %{notification_settings: %{"followers" => false}}) followed = insert(:user, info: %{notification_settings: %{"followers" => false}})

View file

@ -78,8 +78,6 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
user = insert(:user) user = insert(:user)
notification_settings = %{ notification_settings = %{
"remote" => true,
"local" => true,
"followers" => true, "followers" => true,
"follows" => true, "follows" => true,
"non_follows" => true, "non_follows" => true,

View file

@ -102,7 +102,6 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
conn conn
|> assign(:user, user) |> assign(:user, user)
|> put("/api/pleroma/notification_settings", %{ |> put("/api/pleroma/notification_settings", %{
"remote" => false,
"followers" => false, "followers" => false,
"bar" => 1 "bar" => 1
}) })
@ -111,8 +110,6 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
user = Repo.get(User, user.id) user = Repo.get(User, user.id)
assert %{ assert %{
"remote" => false,
"local" => true,
"followers" => false, "followers" => false,
"follows" => true, "follows" => true,
"non_follows" => true, "non_follows" => true,