diff options
author | lain <lain@soykaf.club> | 2020-05-11 17:14:58 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-05-11 17:14:58 +0200 |
commit | f28ed36b4daf2f7ed2e35b90b07a5b0552b2a2c9 (patch) | |
tree | 337f5fe20d87a86bbba0da1d47ff1dea4cd0a340 /test/web/common_api/common_api_test.exs | |
parent | fdb98715b8e6ced7c4037b1292fb10980a994803 (diff) | |
parent | e4323141056afc47c2bef7352aaca90edc467a64 (diff) | |
download | pleroma-f28ed36b4daf2f7ed2e35b90b07a5b0552b2a2c9.tar.gz |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r-- | test/web/common_api/common_api_test.exs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index 5501ba18b..bc204e6e8 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -76,6 +76,24 @@ defmodule Pleroma.Web.CommonAPITest do end describe "deletion" do + test "it works with pruned objects" do + user = insert(:user) + + {:ok, post} = CommonAPI.post(user, %{"status" => "namu amida butsu"}) + + Object.normalize(post, false) + |> Object.prune() + + with_mock Pleroma.Web.Federator, + publish: fn _ -> nil end do + assert {:ok, delete} = CommonAPI.delete(post.id, user) + assert delete.local + assert called(Pleroma.Web.Federator.publish(delete)) + end + + refute Activity.get_by_id(post.id) + end + test "it allows users to delete their posts" do user = insert(:user) |