summaryrefslogtreecommitdiff
path: root/test/web/ostatus/incoming_documents/delete_handling_test.exs
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-04-17 12:22:32 +0300
committerrinpatch <rinpatch@sdf.org>2019-04-17 12:22:32 +0300
commit627e5a0a4992cc19fc65a7e93a09c470c8e2bf33 (patch)
tree0f38b475e8554863a1cbbd7750c19d4cd1336eb1 /test/web/ostatus/incoming_documents/delete_handling_test.exs
parentd6ab701a14f7c9fb4d59953648c425e04725fc62 (diff)
parent73df3046e014ae16e03f16a9c82921652cefcb54 (diff)
downloadpleroma-627e5a0a4992cc19fc65a7e93a09c470c8e2bf33.tar.gz
pleroma-627e5a0a4992cc19fc65a7e93a09c470c8e2bf33.zip
Merge branch 'develop' into feature/database-compaction
Diffstat (limited to 'test/web/ostatus/incoming_documents/delete_handling_test.exs')
-rw-r--r--test/web/ostatus/incoming_documents/delete_handling_test.exs18
1 files changed, 13 insertions, 5 deletions
diff --git a/test/web/ostatus/incoming_documents/delete_handling_test.exs b/test/web/ostatus/incoming_documents/delete_handling_test.exs
index 1e041e5b0..ca6e61339 100644
--- a/test/web/ostatus/incoming_documents/delete_handling_test.exs
+++ b/test/web/ostatus/incoming_documents/delete_handling_test.exs
@@ -2,9 +2,17 @@ defmodule Pleroma.Web.OStatus.DeleteHandlingTest do
use Pleroma.DataCase
import Pleroma.Factory
- alias Pleroma.{Repo, Activity, Object}
+ import Tesla.Mock
+
+ alias Pleroma.Activity
+ alias Pleroma.Object
alias Pleroma.Web.OStatus
+ setup do
+ mock(fn env -> apply(HttpRequestMock, :request, [env]) end)
+ :ok
+ end
+
describe "deletions" do
test "it removes the mentioned activity" do
note = insert(:note_activity)
@@ -23,10 +31,10 @@ defmodule Pleroma.Web.OStatus.DeleteHandlingTest do
{:ok, [delete]} = OStatus.handle_incoming(incoming)
- refute Repo.get(Activity, note.id)
- refute Repo.get(Activity, like.id)
- refute Object.get_by_ap_id(note.data["object"]["id"])
- assert Repo.get(Activity, second_note.id)
+ 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 Activity.get_by_id(second_note.id)
assert Object.get_by_ap_id(second_note.data["object"]["id"])
assert delete.data["type"] == "Delete"