Transmogrifier: fetch quoted post

This commit is contained in:
Alex Gleason 2022-01-22 18:46:58 -06:00 committed by tusooa
commit f01e2d0902
No known key found for this signature in database
GPG key ID: 42AEC43D48433C51
5 changed files with 165 additions and 0 deletions

View file

@ -136,6 +136,28 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
tag = object.data["tag"] |> List.first()
assert tag["type"] == "Mention"
end
test "it accepts quote posts" do
insert(:user, ap_id: "https://misskey.io/users/7rkrarq81i")
object = File.read!("test/fixtures/quote_post/misskey_quote_post.json") |> Jason.decode!()
message = %{
"@context" => "https://www.w3.org/ns/activitystreams",
"type" => "Create",
"actor" => "https://misskey.io/users/7rkrarq81i",
"object" => object
}
assert {:ok, activity} = Transmogrifier.handle_incoming(message)
# Object was created in the database
object = Object.normalize(activity)
assert object.data["quoteUrl"] == "https://misskey.io/notes/8vs6wxufd0"
# It fetched the quoted post
assert Object.normalize("https://misskey.io/notes/8vs6wxufd0")
end
end
describe "prepare outgoing" do