summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2024-08-28 16:04:12 -0400
committerMark Felder <feld@feld.me>2024-08-28 16:04:12 -0400
commit66e1b4089528dcd5bcdb61343f111cea03f17ab8 (patch)
tree05990442930e23b6698e6e0df1f2d460124568aa /test
parent60101e240dea53c3496eda548dbe269fc22b2f72 (diff)
downloadpleroma-66e1b4089528dcd5bcdb61343f111cea03f17ab8.tar.gz
pleroma-66e1b4089528dcd5bcdb61343f111cea03f17ab8.zip
Cancel if the User fetch resulted in a 410
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/workers/receiver_worker_test.exs23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/pleroma/workers/receiver_worker_test.exs b/test/pleroma/workers/receiver_worker_test.exs
index 2c0da8887..085108e37 100644
--- a/test/pleroma/workers/receiver_worker_test.exs
+++ b/test/pleroma/workers/receiver_worker_test.exs
@@ -65,6 +65,12 @@ defmodule Pleroma.Workers.ReceiverWorkerTest do
status: 404,
body: ""
}
+
+ %{url: "https://springfield.social/users/hankscorpio"} ->
+ %Tesla.Env{
+ status: 410,
+ body: ""
+ }
end)
end
@@ -101,6 +107,23 @@ defmodule Pleroma.Workers.ReceiverWorkerTest do
assert {:cancel, {:error, :not_found}} = ReceiverWorker.perform(oban_job)
end
+
+ test "when request returns a 410" do
+ params =
+ insert(:note_activity).data
+ |> Map.put("actor", "https://springfield.social/users/hankscorpio")
+
+ {:ok, oban_job} =
+ Federator.incoming_ap_doc(%{
+ method: "POST",
+ req_headers: [],
+ request_path: "/inbox",
+ params: params,
+ query_string: ""
+ })
+
+ assert {:cancel, {:error, :not_found}} = ReceiverWorker.perform(oban_job)
+ end
end
test "it can validate the signature" do