summaryrefslogtreecommitdiff
path: root/test/web/ostatus/incoming_documents/delete_handling_test.exs
diff options
context:
space:
mode:
authorRoman Chvanikov <chvanikoff@pm.me>2019-07-12 18:08:27 +0300
committerRoman Chvanikov <chvanikoff@pm.me>2019-07-12 18:08:27 +0300
commiteae991b06a22bf7fc3eef7a0d5b409c931c1f6cb (patch)
tree77cd19ea54b8efa69e45b2d37876e7d5084cf38e /test/web/ostatus/incoming_documents/delete_handling_test.exs
parent371d39e160efa51f2fe608e1788f6b11b89d9839 (diff)
parentdb75288b71e7531f8e5033f56fc0b9a7d1d8efb3 (diff)
downloadpleroma-eae991b06a22bf7fc3eef7a0d5b409c931c1f6cb.tar.gz
pleroma-eae991b06a22bf7fc3eef7a0d5b409c931c1f6cb.zip
merge develop
Diffstat (limited to 'test/web/ostatus/incoming_documents/delete_handling_test.exs')
-rw-r--r--test/web/ostatus/incoming_documents/delete_handling_test.exs13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/web/ostatus/incoming_documents/delete_handling_test.exs b/test/web/ostatus/incoming_documents/delete_handling_test.exs
index ca6e61339..cd0447af7 100644
--- a/test/web/ostatus/incoming_documents/delete_handling_test.exs
+++ b/test/web/ostatus/incoming_documents/delete_handling_test.exs
@@ -1,3 +1,7 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.Web.OStatus.DeleteHandlingTest do
use Pleroma.DataCase
@@ -17,8 +21,9 @@ defmodule Pleroma.Web.OStatus.DeleteHandlingTest do
test "it removes the mentioned activity" do
note = insert(:note_activity)
second_note = insert(:note_activity)
+ object = Object.normalize(note)
+ second_object = Object.normalize(second_note)
user = insert(:user)
- object = Object.get_by_ap_id(note.data["object"]["id"])
{:ok, like, _object} = Pleroma.Web.ActivityPub.ActivityPub.like(user, object)
@@ -26,16 +31,16 @@ defmodule Pleroma.Web.OStatus.DeleteHandlingTest do
File.read!("test/fixtures/delete.xml")
|> String.replace(
"tag:mastodon.sdf.org,2017-06-10:objectId=310513:objectType=Status",
- note.data["object"]["id"]
+ object.data["id"]
)
{:ok, [delete]} = OStatus.handle_incoming(incoming)
refute Activity.get_by_id(note.id)
refute Activity.get_by_id(like.id)
- assert Object.get_by_ap_id(note.data["object"]["id"]).data["type"] == "Tombstone"
+ assert Object.get_by_ap_id(object.data["id"]).data["type"] == "Tombstone"
assert Activity.get_by_id(second_note.id)
- assert Object.get_by_ap_id(second_note.data["object"]["id"])
+ assert Object.get_by_ap_id(second_object.data["id"])
assert delete.data["type"] == "Delete"
end