1 defmodule Pleroma.Web.OStatus.DeleteHandlingTest do
9 alias Pleroma.Web.OStatus
12 mock(fn env -> apply(HttpRequestMock, :request, [env]) end)
16 describe "deletions" do
17 test "it removes the mentioned activity" do
18 note = insert(:note_activity)
19 second_note = insert(:note_activity)
21 object = Object.get_by_ap_id(note.data["object"]["id"])
23 {:ok, like, _object} = Pleroma.Web.ActivityPub.ActivityPub.like(user, object)
26 File.read!("test/fixtures/delete.xml")
28 "tag:mastodon.sdf.org,2017-06-10:objectId=310513:objectType=Status",
29 note.data["object"]["id"]
32 {:ok, [delete]} = OStatus.handle_incoming(incoming)
34 refute Activity.get_by_id(note.id)
35 refute Activity.get_by_id(like.id)
36 assert Object.get_by_ap_id(note.data["object"]["id"]).data["type"] == "Tombstone"
37 assert Activity.get_by_id(second_note.id)
38 assert Object.get_by_ap_id(second_note.data["object"]["id"])
40 assert delete.data["type"] == "Delete"