projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Apply suggestion to lib/pleroma/web/templates/layout/email_styled.html.eex
[akkoma]
/
test
/
notification_test.exs
diff --git
a/test/notification_test.exs
b/test/notification_test.exs
index 730d87d91d0508059614039939fe40e0d845f167..9a1c2f2b5ea969a416c5d352e0639ea834406c0e 100644
(file)
--- a/
test/notification_test.exs
+++ b/
test/notification_test.exs
@@
-93,12
+93,12
@@
defmodule Pleroma.NotificationTest do
activity = insert(:note_activity)
author = User.get_cached_by_ap_id(activity.data["actor"])
user = insert(:user)
activity = insert(:note_activity)
author = User.get_cached_by_ap_id(activity.data["actor"])
user = insert(:user)
- {:ok,
user
} = User.block(user, author)
+ {:ok,
_user_relationship
} = User.block(user, author)
assert Notification.create_notification(activity, user)
end
assert Notification.create_notification(activity, user)
end
- test "it creates a notificatin for the user if the user mutes the activity author" do
+ test "it creates a notificati
o
n for the user if the user mutes the activity author" do
muter = insert(:user)
muted = insert(:user)
{:ok, _} = User.mute(muter, muted)
muter = insert(:user)
muted = insert(:user)
{:ok, _} = User.mute(muter, muted)
@@
-112,7
+112,7
@@
defmodule Pleroma.NotificationTest do
muter = insert(:user)
muted = insert(:user)
muter = insert(:user)
muted = insert(:user)
- {:ok,
muter
} = User.mute(muter, muted, false)
+ {:ok,
_user_relationships
} = User.mute(muter, muted, false)
{:ok, activity} = CommonAPI.post(muted, %{"status" => "Hi @#{muter.nickname}"})
{:ok, activity} = CommonAPI.post(muted, %{"status" => "Hi @#{muter.nickname}"})
@@
-655,13
+655,17
@@
defmodule Pleroma.NotificationTest do
Pleroma.Web.ActivityPub.ActivityPub.move(old_user, new_user)
ObanHelpers.perform_all()
Pleroma.Web.ActivityPub.ActivityPub.move(old_user, new_user)
ObanHelpers.perform_all()
+ assert [] = Notification.for_user(follower)
+
assert [
%{
activity: %{
data: %{"type" => "Move", "actor" => ^old_ap_id, "target" => ^new_ap_id}
}
}
assert [
%{
activity: %{
data: %{"type" => "Move", "actor" => ^old_ap_id, "target" => ^new_ap_id}
}
}
- ] = Notification.for_user(follower)
+ ] = Notification.for_user(follower, %{with_move: true})
+
+ assert [] = Notification.for_user(other_follower)
assert [
%{
assert [
%{
@@
-669,7
+673,7
@@
defmodule Pleroma.NotificationTest do
data: %{"type" => "Move", "actor" => ^old_ap_id, "target" => ^new_ap_id}
}
}
data: %{"type" => "Move", "actor" => ^old_ap_id, "target" => ^new_ap_id}
}
}
- ] = Notification.for_user(other_follower)
+ ] = Notification.for_user(other_follower
, %{with_move: true}
)
end
end
end
end
@@
-677,7
+681,7
@@
defmodule Pleroma.NotificationTest do
test "it returns notifications for muted user without notifications" do
user = insert(:user)
muted = insert(:user)
test "it returns notifications for muted user without notifications" do
user = insert(:user)
muted = insert(:user)
- {:ok,
user
} = User.mute(user, muted, false)
+ {:ok,
_user_relationships
} = User.mute(user, muted, false)
{:ok, _activity} = CommonAPI.post(muted, %{"status" => "hey @#{user.nickname}"})
{:ok, _activity} = CommonAPI.post(muted, %{"status" => "hey @#{user.nickname}"})
@@
-687,7
+691,7
@@
defmodule Pleroma.NotificationTest do
test "it doesn't return notifications for muted user with notifications" do
user = insert(:user)
muted = insert(:user)
test "it doesn't return notifications for muted user with notifications" do
user = insert(:user)
muted = insert(:user)
- {:ok,
user
} = User.mute(user, muted)
+ {:ok,
_user_relationships
} = User.mute(user, muted)
{:ok, _activity} = CommonAPI.post(muted, %{"status" => "hey @#{user.nickname}"})
{:ok, _activity} = CommonAPI.post(muted, %{"status" => "hey @#{user.nickname}"})
@@
-697,7
+701,7
@@
defmodule Pleroma.NotificationTest do
test "it doesn't return notifications for blocked user" do
user = insert(:user)
blocked = insert(:user)
test "it doesn't return notifications for blocked user" do
user = insert(:user)
blocked = insert(:user)
- {:ok,
user
} = User.block(user, blocked)
+ {:ok,
_user_relationship
} = User.block(user, blocked)
{:ok, _activity} = CommonAPI.post(blocked, %{"status" => "hey @#{user.nickname}"})
{:ok, _activity} = CommonAPI.post(blocked, %{"status" => "hey @#{user.nickname}"})
@@
-727,7
+731,7
@@
defmodule Pleroma.NotificationTest do
test "it returns notifications from a muted user when with_muted is set" do
user = insert(:user)
muted = insert(:user)
test "it returns notifications from a muted user when with_muted is set" do
user = insert(:user)
muted = insert(:user)
- {:ok,
user
} = User.mute(user, muted)
+ {:ok,
_user_relationships
} = User.mute(user, muted)
{:ok, _activity} = CommonAPI.post(muted, %{"status" => "hey @#{user.nickname}"})
{:ok, _activity} = CommonAPI.post(muted, %{"status" => "hey @#{user.nickname}"})
@@
-737,11
+741,11
@@
defmodule Pleroma.NotificationTest do
test "it doesn't return notifications from a blocked user when with_muted is set" do
user = insert(:user)
blocked = insert(:user)
test "it doesn't return notifications from a blocked user when with_muted is set" do
user = insert(:user)
blocked = insert(:user)
- {:ok,
user
} = User.block(user, blocked)
+ {:ok,
_user_relationship
} = User.block(user, blocked)
{:ok, _activity} = CommonAPI.post(blocked, %{"status" => "hey @#{user.nickname}"})
{:ok, _activity} = CommonAPI.post(blocked, %{"status" => "hey @#{user.nickname}"})
- assert
length(Notification.for_user(user, %{with_muted: true})) == 0
+ assert
Enum.empty?(Notification.for_user(user, %{with_muted: true}))
end
test "it doesn't return notifications from a domain-blocked user when with_muted is set" do
end
test "it doesn't return notifications from a domain-blocked user when with_muted is set" do
@@
-751,7
+755,7
@@
defmodule Pleroma.NotificationTest do
{:ok, _activity} = CommonAPI.post(blocked, %{"status" => "hey @#{user.nickname}"})
{:ok, _activity} = CommonAPI.post(blocked, %{"status" => "hey @#{user.nickname}"})
- assert
length(Notification.for_user(user, %{with_muted: true})) == 0
+ assert
Enum.empty?(Notification.for_user(user, %{with_muted: true}))
end
test "it returns notifications from muted threads when with_muted is set" do
end
test "it returns notifications from muted threads when with_muted is set" do