summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2022-01-22 22:29:13 -0600
committertusooa <tusooa@kazv.moe>2023-09-13 19:19:03 -0400
commitc20e90e898affc9d00d8b7d6b71f11157f5c7837 (patch)
treee6c93a826cbc1289953a2a1ae623b56fda764383
parentd4fea8b5595e9e6cd37bdb1cee21285f905693f1 (diff)
downloadpleroma-c20e90e898affc9d00d8b7d6b71f11157f5c7837.tar.gz
pleroma-c20e90e898affc9d00d8b7d6b71f11157f5c7837.zip
BuilderTest: build quote post
-rw-r--r--test/pleroma/web/activity_pub/builder_test.exs29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/pleroma/web/activity_pub/builder_test.exs b/test/pleroma/web/activity_pub/builder_test.exs
index eb175a1be..52058a0a3 100644
--- a/test/pleroma/web/activity_pub/builder_test.exs
+++ b/test/pleroma/web/activity_pub/builder_test.exs
@@ -44,5 +44,34 @@ defmodule Pleroma.Web.ActivityPub.BuilderTest do
assert {:ok, ^expected, []} = Builder.note(draft)
end
+
+ test "quote post" do
+ user = insert(:user)
+ note = insert(:note)
+
+ draft = %ActivityDraft{
+ user: user,
+ context: "2hu",
+ content_html: "<h1>This is :moominmamma: note</h1>",
+ quote_post: note,
+ extra: %{}
+ }
+
+ expected = %{
+ "actor" => user.ap_id,
+ "attachment" => [],
+ "content" => "<h1>This is :moominmamma: note</h1>",
+ "context" => "2hu",
+ "sensitive" => false,
+ "type" => "Note",
+ "quoteUrl" => note.data["id"],
+ "cc" => [],
+ "summary" => nil,
+ "tag" => [],
+ "to" => []
+ }
+
+ assert {:ok, ^expected, []} = Builder.note(draft)
+ end
end
end