ObjectValidators: improve quoteUrl compatibility

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

View file

@ -116,4 +116,24 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNotePageValidatorTest
%{valid?: true} = ArticleNotePageValidator.cast_and_validate(note)
end
test "Fedibird quote post" do
insert(:user, ap_id: "https://fedibird.com/users/noellabo")
data = File.read!("test/fixtures/quote_post/fedibird_quote_post.json") |> Jason.decode!()
chg = ArticleNotePageValidator.cast_and_validate(data)
assert chg.valid?
assert chg.changes.quoteUrl == "https://misskey.io/notes/8vsn2izjwh"
end
test "Misskey quote post" do
insert(:user, ap_id: "https://misskey.io/users/7rkrarq81i")
data = File.read!("test/fixtures/quote_post/misskey_quote_post.json") |> Jason.decode!()
chg = ArticleNotePageValidator.cast_and_validate(data)
assert chg.valid?
assert chg.changes.quoteUrl == "https://misskey.io/notes/8vs6wxufd0"
end
end