Fix an AP test

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-06-07 11:06:59 +02:00
parent 005f7e20ca
commit 901c88d741
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
2 changed files with 29 additions and 17 deletions

View file

@ -40,7 +40,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier.CommentsTest do
File.read!("test/fixtures/mastodon-post-activity.json") File.read!("test/fixtures/mastodon-post-activity.json")
|> Jason.decode!() |> Jason.decode!()
reply_to_url = "https://soc.punktrash.club/objects/d811df79-6e54-4f51-841e-0c38bc356467" reply_to_url = "https://fedi.absturztau.be/objects/1726cdc7-4f2a-4ddb-9c68-03d27c98c3d9"
object = object =
data["object"] data["object"]
@ -65,11 +65,11 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier.CommentsTest do
%Comment{} = %Comment{} =
origin_comment = origin_comment =
Discussions.get_comment_from_url( Discussions.get_comment_from_url(
"https://soc.punktrash.club/objects/d811df79-6e54-4f51-841e-0c38bc356467" "https://fedi.absturztau.be/objects/1726cdc7-4f2a-4ddb-9c68-03d27c98c3d9"
) )
assert returned_activity.data["object"]["inReplyTo"] == assert returned_activity.data["object"]["inReplyTo"] ==
"https://soc.punktrash.club/objects/d811df79-6e54-4f51-841e-0c38bc356467" "https://fedi.absturztau.be/objects/1726cdc7-4f2a-4ddb-9c68-03d27c98c3d9"
assert returned_activity.data["object"]["inReplyTo"] == origin_comment.url assert returned_activity.data["object"]["inReplyTo"] == origin_comment.url
end end

View file

@ -1,25 +1,37 @@
{ {
"@context": [ "@context": [
"https://www.w3.org/ns/activitystreams", "https://www.w3.org/ns/activitystreams",
"https://soc.punktrash.club/schemas/litepub-0.1.jsonld", "https://fedi.absturztau.be/schemas/litepub-0.1.jsonld",
{ {
"@language": "und" "@language": "und"
} }
], ],
"actor": "https://soc.punktrash.club/users/jorin", "actor": "https://fedi.absturztau.be/users/dqn",
"attachment": [], "attachment": [
"attributedTo": "https://soc.punktrash.club/users/jorin", {
"cc": ["https://soc.punktrash.club/users/jorin/followers"], "mediaType": "image/jpeg",
"content": "I live in Spain<br><br>The S is silent<br><br>And it&#39;s French<br><br>🥖😎", "name": "",
"context": "https://soc.punktrash.club/contexts/62eb8f27-c8ea-4cc3-818d-385ff96e4397", "type": "Document",
"conversation": "https://soc.punktrash.club/contexts/62eb8f27-c8ea-4cc3-818d-385ff96e4397", "url": "https://fedi.absturztau.be/media/f96e58881c72844e8e233b78f7e53ab93d8308dcf2118e493fcf53d5cc968ea6.jpg?name=p5d85wsralb61.jpg"
"id": "https://soc.punktrash.club/objects/d811df79-6e54-4f51-841e-0c38bc356467", }
"published": "2021-05-06T03:52:10.195835Z", ],
"repliesCount": 1, "attributedTo": "https://fedi.absturztau.be/users/dqn",
"sensitive": false, "cc": ["https://fedi.absturztau.be/users/dqn/followers"],
"source": "I live in Spain\n\nThe S is silent\n\nAnd it's French\n\n🥖😎", "content": "<a class=\"hashtag\" data-tag=\"animeirl\" href=\"https://fedi.absturztau.be/tag/animeirl\" rel=\"tag ugc\">#animeirl</a><br><a href=\"https://fedi.absturztau.be/media/f96e58881c72844e8e233b78f7e53ab93d8308dcf2118e493fcf53d5cc968ea6.jpg?name=p5d85wsralb61.jpg\" class='attachment'></a>",
"context": "https://fedi.absturztau.be/contexts/4adddb80-0236-4e03-8a83-94be817b5dbe",
"conversation": "https://fedi.absturztau.be/contexts/4adddb80-0236-4e03-8a83-94be817b5dbe",
"id": "https://fedi.absturztau.be/objects/1726cdc7-4f2a-4ddb-9c68-03d27c98c3d9",
"published": "2021-06-07T09:00:04.292206Z",
"sensitive": null,
"source": "#animeirl",
"summary": "", "summary": "",
"tag": [], "tag": [
{
"href": "https://fedi.absturztau.be/tags/animeirl",
"name": "#animeirl",
"type": "Hashtag"
}
],
"to": ["https://www.w3.org/ns/activitystreams#Public"], "to": ["https://www.w3.org/ns/activitystreams#Public"],
"type": "Note" "type": "Note"
} }