diff options
| author | lain <lain@soykaf.club> | 2020-05-05 18:00:37 +0200 |
|---|---|---|
| committer | lain <lain@soykaf.club> | 2020-05-05 18:02:24 +0200 |
| commit | 92caae592338a3ca307686e7644f2de18bb57ce5 (patch) | |
| tree | fff0ee1670ea7c396ffbcd350ccc68ed8408402d /test/web/activity_pub/activity_pub_test.exs | |
| parent | a3bb2e5474ee068bf375b24df8906e51654c9699 (diff) | |
| download | pleroma-92caae592338a3ca307686e7644f2de18bb57ce5.tar.gz pleroma-92caae592338a3ca307686e7644f2de18bb57ce5.zip | |
Undoing: Move undoing blocks to the pipeline everywhere.
Diffstat (limited to 'test/web/activity_pub/activity_pub_test.exs')
| -rw-r--r-- | test/web/activity_pub/activity_pub_test.exs | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/test/web/activity_pub/activity_pub_test.exs b/test/web/activity_pub/activity_pub_test.exs index 2c3d354f2..7824095c7 100644 --- a/test/web/activity_pub/activity_pub_test.exs +++ b/test/web/activity_pub/activity_pub_test.exs @@ -1114,7 +1114,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do end end - describe "blocking / unblocking" do + describe "blocking" do test "reverts block activity on error" do [blocker, blocked] = insert_list(2, :user) @@ -1136,38 +1136,6 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do assert activity.data["actor"] == blocker.ap_id assert activity.data["object"] == blocked.ap_id end - - test "reverts unblock activity on error" do - [blocker, blocked] = insert_list(2, :user) - {:ok, block_activity} = ActivityPub.block(blocker, blocked) - - with_mock(Utils, [:passthrough], maybe_federate: fn _ -> {:error, :reverted} end) do - assert {:error, :reverted} = ActivityPub.unblock(blocker, blocked) - end - - assert block_activity.data["type"] == "Block" - assert block_activity.data["actor"] == blocker.ap_id - - assert Repo.aggregate(Activity, :count, :id) == 1 - assert Repo.aggregate(Object, :count, :id) == 1 - end - - test "creates an undo activity for the last block" do - blocker = insert(:user) - blocked = insert(:user) - - {:ok, block_activity} = ActivityPub.block(blocker, blocked) - {:ok, activity} = ActivityPub.unblock(blocker, blocked) - - assert activity.data["type"] == "Undo" - assert activity.data["actor"] == blocker.ap_id - - embedded_object = activity.data["object"] - assert is_map(embedded_object) - assert embedded_object["type"] == "Block" - assert embedded_object["object"] == blocked.ap_id - assert embedded_object["id"] == block_activity.data["id"] - end end describe "deletion" do |
