projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'add-test-update_credentials' into 'develop'
[akkoma]
/
test
/
web
/
activity_pub
/
activity_pub_test.exs
diff --git
a/test/web/activity_pub/activity_pub_test.exs
b/test/web/activity_pub/activity_pub_test.exs
index 3dd3dd04dcd878959cbba77e38b9398d5cc3ce12..049b14498ec6bd69c40e50160451bc96b9aaf249 100644
(file)
--- a/
test/web/activity_pub/activity_pub_test.exs
+++ b/
test/web/activity_pub/activity_pub_test.exs
@@
-27,7
+27,7
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
:ok
end
:ok
end
- clear_config([:instance, :federating])
+
setup do:
clear_config([:instance, :federating])
describe "streaming out participations" do
test "it streams them out" do
describe "streaming out participations" do
test "it streams them out" do
@@
-1396,7
+1396,7
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
end
describe "deletion" do
end
describe "deletion" do
- clear_config([:instance, :rewrite_policy])
+
setup do:
clear_config([:instance, :rewrite_policy])
test "it reverts deletion on error" do
note = insert(:note_activity)
test "it reverts deletion on error" do
note = insert(:note_activity)
@@
-1425,6
+1425,12
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
assert Repo.get(Object, object.id).data["type"] == "Tombstone"
end
assert Repo.get(Object, object.id).data["type"] == "Tombstone"
end
+ test "it doesn't fail when an activity was already deleted" do
+ {:ok, delete} = insert(:note_activity) |> Object.normalize() |> ActivityPub.delete()
+
+ assert {:ok, ^delete} = delete |> Object.normalize() |> ActivityPub.delete()
+ end
+
test "decrements user note count only for public activities" do
user = insert(:user, note_count: 10)
test "decrements user note count only for public activities" do
user = insert(:user, note_count: 10)
@@
-1580,7
+1586,7
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
end
describe "update" do
end
describe "update" do
- clear_config([:instance, :max_pinned_statuses])
+
setup do:
clear_config([:instance, :max_pinned_statuses])
test "it creates an update activity with the new user data" do
user = insert(:user)
test "it creates an update activity with the new user data" do
user = insert(:user)
@@
-1955,11
+1961,9
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
activity = %Activity{activity | object: nil}
activity = %Activity{activity | object: nil}
- assert [%Notification{activity: ^activity}] =
- Notification.for_user(follower, %{with_move: true})
+ assert [%Notification{activity: ^activity}] = Notification.for_user(follower)
- assert [%Notification{activity: ^activity}] =
- Notification.for_user(follower_move_opted_out, %{with_move: true})
+ assert [%Notification{activity: ^activity}] = Notification.for_user(follower_move_opted_out)
end
test "old user must be in the new user's `also_known_as` list" do
end
test "old user must be in the new user's `also_known_as` list" do