diff options
author | lain <lain@soykaf.club> | 2020-12-23 13:35:41 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-12-23 13:35:41 +0000 |
commit | f64237927c05173e4f29dbbd2a563f123690da7e (patch) | |
tree | 9b04b38c735ba732066dcaf0323aa53c1da90622 /test/pleroma/web/activity_pub/activity_pub_test.exs | |
parent | 15550f7c4bf75401d0f18add0f847f640acc6627 (diff) | |
parent | 843d2074fe79637016579c27062889a7e5371b7a (diff) | |
download | pleroma-2.2.1.tar.gz |
Merge branch 'release/2.2.1' into 'stable'v2.2.1
Release/2.2.1
See merge request pleroma/pleroma!3214
Diffstat (limited to 'test/pleroma/web/activity_pub/activity_pub_test.exs')
-rw-r--r-- | test/pleroma/web/activity_pub/activity_pub_test.exs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/pleroma/web/activity_pub/activity_pub_test.exs b/test/pleroma/web/activity_pub/activity_pub_test.exs index c6ca37847..ef93b7859 100644 --- a/test/pleroma/web/activity_pub/activity_pub_test.exs +++ b/test/pleroma/web/activity_pub/activity_pub_test.exs @@ -1282,6 +1282,31 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do assert_called(Utils.maybe_federate(%{activity | data: new_data})) end + + test_with_mock "reverts on error", + %{ + reporter: reporter, + context: context, + target_account: target_account, + reported_activity: reported_activity, + content: content + }, + Utils, + [:passthrough], + maybe_federate: fn _ -> {:error, :reverted} end do + assert {:error, :reverted} = + ActivityPub.flag(%{ + actor: reporter, + context: context, + account: target_account, + statuses: [reported_activity], + content: content + }) + + assert Repo.aggregate(Activity, :count, :id) == 1 + assert Repo.aggregate(Object, :count, :id) == 2 + assert Repo.aggregate(Notification, :count, :id) == 0 + end end test "fetch_activities/2 returns activities addressed to a list " do |