summaryrefslogtreecommitdiff
path: root/test/web/ostatus/incoming_documents/delete_handling_test.exs
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-07-09 20:00:37 +0000
committerrinpatch <rinpatch@sdf.org>2019-07-09 20:00:37 +0000
commit81f1017b84bbe1a493aaf6f43687af2f2546b6a1 (patch)
treebb2d77d97f46f51c7d3b3e719fe29faac41432af /test/web/ostatus/incoming_documents/delete_handling_test.exs
parent2bb945cb70751bc8e72c036040130bb54c32f391 (diff)
parent8a41d34673532c03cf99a2334399b9436e245f1b (diff)
downloadpleroma-81f1017b84bbe1a493aaf6f43687af2f2546b6a1.tar.gz
pleroma-81f1017b84bbe1a493aaf6f43687af2f2546b6a1.zip
Merge branch '878-activity-object-decoupling-in-tests' into 'develop'
[#878] Refactored assumptions on embedded object presence in tests Closes #878 See merge request pleroma/pleroma!1390
Diffstat (limited to 'test/web/ostatus/incoming_documents/delete_handling_test.exs')
-rw-r--r--test/web/ostatus/incoming_documents/delete_handling_test.exs9
1 files changed, 5 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..1fe714d00 100644
--- a/test/web/ostatus/incoming_documents/delete_handling_test.exs
+++ b/test/web/ostatus/incoming_documents/delete_handling_test.exs
@@ -17,8 +17,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 +27,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