diff options
author | Alex Gleason <alex@alexgleason.me> | 2022-01-22 22:29:13 -0600 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2022-01-22 22:29:13 -0600 |
commit | 4b2fe550def089b1f2ae24f922c871ec2dadf41c (patch) | |
tree | 5a8d2d5c3129cfcba44c5e62a08abdb40f943c7f | |
parent | 69cab8da8968a9581797c9812be8d4871478b687 (diff) | |
download | pleroma-4b2fe550def089b1f2ae24f922c871ec2dadf41c.tar.gz |
BuilderTest: build quote post
-rw-r--r-- | test/pleroma/web/activity_pub/builder_test.exs | 29 |
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 3fe32bce5..32930492f 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 |