projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[Credo] fix Credo.Check.Readability.AliasOrder
[akkoma]
/
test
/
notification_test.exs
diff --git
a/test/notification_test.exs
b/test/notification_test.exs
index 94fb0ab154ae81a10583041a549f247091632cc7..12b4292aa8c4259aa977303b3a0695abb9dbcf5c 100644
(file)
--- a/
test/notification_test.exs
+++ b/
test/notification_test.exs
@@
-4,10
+4,11
@@
defmodule Pleroma.NotificationTest do
use Pleroma.DataCase
defmodule Pleroma.NotificationTest do
use Pleroma.DataCase
- alias Pleroma.Web.TwitterAPI.TwitterAPI
- alias Pleroma.Web.CommonAPI
- alias Pleroma.{User, Notification}
+ alias Pleroma.Notification
+ alias Pleroma.User
alias Pleroma.Web.ActivityPub.Transmogrifier
alias Pleroma.Web.ActivityPub.Transmogrifier
+ alias Pleroma.Web.CommonAPI
+ alias Pleroma.Web.TwitterAPI.TwitterAPI
import Pleroma.Factory
describe "create_notifications" do
import Pleroma.Factory
describe "create_notifications" do
@@
-299,7
+300,7
@@
defmodule Pleroma.NotificationTest do
{:ok, activity} = CommonAPI.post(user, %{"status" => "test post"})
{:ok, activity} = CommonAPI.post(user, %{"status" => "test post"})
- assert
length(Notification.for_user(user)) == 0
+ assert
Enum.empty?(Notification.for_user(user))
{:ok, _, _} = CommonAPI.favorite(activity.id, other_user)
{:ok, _, _} = CommonAPI.favorite(activity.id, other_user)
@@
-307,7
+308,7
@@
defmodule Pleroma.NotificationTest do
{:ok, _} = CommonAPI.delete(activity.id, user)
{:ok, _} = CommonAPI.delete(activity.id, user)
- assert
length(Notification.for_user(user)) == 0
+ assert
Enum.empty?(Notification.for_user(user))
end
test "liking an activity results in 1 notification, then 0 if the activity is unliked" do
end
test "liking an activity results in 1 notification, then 0 if the activity is unliked" do
@@
-316,7
+317,7
@@
defmodule Pleroma.NotificationTest do
{:ok, activity} = CommonAPI.post(user, %{"status" => "test post"})
{:ok, activity} = CommonAPI.post(user, %{"status" => "test post"})
- assert
length(Notification.for_user(user)) == 0
+ assert
Enum.empty?(Notification.for_user(user))
{:ok, _, _} = CommonAPI.favorite(activity.id, other_user)
{:ok, _, _} = CommonAPI.favorite(activity.id, other_user)
@@
-324,7
+325,7
@@
defmodule Pleroma.NotificationTest do
{:ok, _, _, _} = CommonAPI.unfavorite(activity.id, other_user)
{:ok, _, _, _} = CommonAPI.unfavorite(activity.id, other_user)
- assert
length(Notification.for_user(user)) == 0
+ assert
Enum.empty?(Notification.for_user(user))
end
test "repeating an activity results in 1 notification, then 0 if the activity is deleted" do
end
test "repeating an activity results in 1 notification, then 0 if the activity is deleted" do
@@
-333,7
+334,7
@@
defmodule Pleroma.NotificationTest do
{:ok, activity} = CommonAPI.post(user, %{"status" => "test post"})
{:ok, activity} = CommonAPI.post(user, %{"status" => "test post"})
- assert
length(Notification.for_user(user)) == 0
+ assert
Enum.empty?(Notification.for_user(user))
{:ok, _, _} = CommonAPI.repeat(activity.id, other_user)
{:ok, _, _} = CommonAPI.repeat(activity.id, other_user)
@@
-341,7
+342,7
@@
defmodule Pleroma.NotificationTest do
{:ok, _} = CommonAPI.delete(activity.id, user)
{:ok, _} = CommonAPI.delete(activity.id, user)
- assert
length(Notification.for_user(user)) == 0
+ assert
Enum.empty?(Notification.for_user(user))
end
test "repeating an activity results in 1 notification, then 0 if the activity is unrepeated" do
end
test "repeating an activity results in 1 notification, then 0 if the activity is unrepeated" do
@@
-350,7
+351,7
@@
defmodule Pleroma.NotificationTest do
{:ok, activity} = CommonAPI.post(user, %{"status" => "test post"})
{:ok, activity} = CommonAPI.post(user, %{"status" => "test post"})
- assert
length(Notification.for_user(user)) == 0
+ assert
Enum.empty?(Notification.for_user(user))
{:ok, _, _} = CommonAPI.repeat(activity.id, other_user)
{:ok, _, _} = CommonAPI.repeat(activity.id, other_user)
@@
-358,7
+359,7
@@
defmodule Pleroma.NotificationTest do
{:ok, _, _} = CommonAPI.unrepeat(activity.id, other_user)
{:ok, _, _} = CommonAPI.unrepeat(activity.id, other_user)
- assert
length(Notification.for_user(user)) == 0
+ assert
Enum.empty?(Notification.for_user(user))
end
test "liking an activity which is already deleted does not generate a notification" do
end
test "liking an activity which is already deleted does not generate a notification" do
@@
-367,15
+368,15
@@
defmodule Pleroma.NotificationTest do
{:ok, activity} = CommonAPI.post(user, %{"status" => "test post"})
{:ok, activity} = CommonAPI.post(user, %{"status" => "test post"})
- assert
length(Notification.for_user(user)) == 0
+ assert
Enum.empty?(Notification.for_user(user))
{:ok, _deletion_activity} = CommonAPI.delete(activity.id, user)
{:ok, _deletion_activity} = CommonAPI.delete(activity.id, user)
- assert
length(Notification.for_user(user)) == 0
+ assert
Enum.empty?(Notification.for_user(user))
{:error, _} = CommonAPI.favorite(activity.id, other_user)
{:error, _} = CommonAPI.favorite(activity.id, other_user)
- assert
length(Notification.for_user(user)) == 0
+ assert
Enum.empty?(Notification.for_user(user))
end
test "repeating an activity which is already deleted does not generate a notification" do
end
test "repeating an activity which is already deleted does not generate a notification" do
@@
-384,15
+385,15
@@
defmodule Pleroma.NotificationTest do
{:ok, activity} = CommonAPI.post(user, %{"status" => "test post"})
{:ok, activity} = CommonAPI.post(user, %{"status" => "test post"})
- assert
length(Notification.for_user(user)) == 0
+ assert
Enum.empty?(Notification.for_user(user))
{:ok, _deletion_activity} = CommonAPI.delete(activity.id, user)
{:ok, _deletion_activity} = CommonAPI.delete(activity.id, user)
- assert
length(Notification.for_user(user)) == 0
+ assert
Enum.empty?(Notification.for_user(user))
{:error, _} = CommonAPI.repeat(activity.id, other_user)
{:error, _} = CommonAPI.repeat(activity.id, other_user)
- assert
length(Notification.for_user(user)) == 0
+ assert
Enum.empty?(Notification.for_user(user))
end
test "replying to a deleted post without tagging does not generate a notification" do
end
test "replying to a deleted post without tagging does not generate a notification" do
@@
-408,7
+409,7
@@
defmodule Pleroma.NotificationTest do
"in_reply_to_status_id" => activity.id
})
"in_reply_to_status_id" => activity.id
})
- assert
length(Notification.for_user(user)) == 0
+ assert
Enum.empty?(Notification.for_user(user))
end
end
end
end
end
end