mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-21 23:56:30 +00:00
Test that a Note from Roadhouse validates
This commit is contained in:
parent
de99fd7804
commit
61dfeca1cc
2 changed files with 120 additions and 0 deletions
109
test/fixtures/roadhouse-create-activity.json
vendored
Normal file
109
test/fixtures/roadhouse-create-activity.json
vendored
Normal file
|
@ -0,0 +1,109 @@
|
|||
{
|
||||
"@context":[
|
||||
"https://www.w3.org/ns/activitystreams",
|
||||
"https://w3id.org/security/v1",
|
||||
{
|
||||
"zot":"https://macgirvin.com/apschema#",
|
||||
"toot":"http://joinmastodon.org/ns#",
|
||||
"ostatus":"http://ostatus.org#",
|
||||
"schema":"http://schema.org#",
|
||||
"litepub":"http://litepub.social/ns#",
|
||||
"sm":"http://smithereen.software/ns#",
|
||||
"conversation":"ostatus:conversation",
|
||||
"manuallyApprovesFollowers":"as:manuallyApprovesFollowers",
|
||||
"oauthRegistrationEndpoint":"litepub:oauthRegistrationEndpoint",
|
||||
"sensitive":"as:sensitive",
|
||||
"movedTo":"as:movedTo",
|
||||
"copiedTo":"as:copiedTo",
|
||||
"alsoKnownAs":"as:alsoKnownAs",
|
||||
"EmojiReact":"as:EmojiReact",
|
||||
"commentPolicy":"zot:commentPolicy",
|
||||
"topicalCollection":"zot:topicalCollection",
|
||||
"eventRepeat":"zot:eventRepeat",
|
||||
"emojiReaction":"zot:emojiReaction",
|
||||
"expires":"zot:expires",
|
||||
"directMessage":"zot:directMessage",
|
||||
"Category":"zot:Category",
|
||||
"replyTo":"zot:replyTo",
|
||||
"PropertyValue":"schema:PropertyValue",
|
||||
"value":"schema:value",
|
||||
"discoverable":"toot:discoverable",
|
||||
"wall":"sm:wall",
|
||||
"capabilities":"litepub:capabilities",
|
||||
"acceptsJoins":"litepub:acceptsJoins"
|
||||
}
|
||||
],
|
||||
"type":"Create",
|
||||
"id":"https://macgirvin.com/activity/ce9ce740-e1cb-4a75-aa4e-9e923555870d",
|
||||
"published":"2022-02-02T04:41:46Z",
|
||||
"context":"https://gleasonator.com/objects/102eb097-a18b-4cd5-abfc-f952efcb70bb",
|
||||
"conversation":"https://gleasonator.com/objects/102eb097-a18b-4cd5-abfc-f952efcb70bb",
|
||||
"actor":"https://macgirvin.com/channel/mike",
|
||||
"replyTo":"https://macgirvin.com/channel/mike",
|
||||
"url":"https://macgirvin.com/activity/ce9ce740-e1cb-4a75-aa4e-9e923555870d",
|
||||
"object":{
|
||||
"type":"Note",
|
||||
"id":"https://macgirvin.com/item/ce9ce740-e1cb-4a75-aa4e-9e923555870d",
|
||||
"published":"2022-02-02T04:41:46Z",
|
||||
"attributedTo":"https://macgirvin.com/channel/mike",
|
||||
"inReplyTo":"https://gleasonator.com/objects/102eb097-a18b-4cd5-abfc-f952efcb70bb",
|
||||
"context":"https://gleasonator.com/objects/102eb097-a18b-4cd5-abfc-f952efcb70bb",
|
||||
"conversation":"https://gleasonator.com/objects/102eb097-a18b-4cd5-abfc-f952efcb70bb",
|
||||
"content":"The Accepts should get through now. Now to figure out why the comments are failing.",
|
||||
"source":{
|
||||
"content":"The Accepts should get through now. Now to figure out why the comments are failing.",
|
||||
"mediaType":"text/x-multicode"
|
||||
},
|
||||
"replyTo":"https://macgirvin.com/channel/mike",
|
||||
"url":"https://macgirvin.com/item/ce9ce740-e1cb-4a75-aa4e-9e923555870d",
|
||||
"tag":[
|
||||
{
|
||||
"type":"Mention",
|
||||
"href":"https://gleasonator.com/users/macgirvin",
|
||||
"name":"@macgirvin@gleasonator.com"
|
||||
},
|
||||
{
|
||||
"type":"Mention",
|
||||
"href":"https://gleasonator.com/users/alex",
|
||||
"name":"@alex@gleasonator.com"
|
||||
}
|
||||
],
|
||||
"to":[
|
||||
"https://www.w3.org/ns/activitystreams#Public",
|
||||
"https://gleasonator.com/users/alex",
|
||||
"https://gleasonator.com/users/macgirvin"
|
||||
],
|
||||
"cc":[
|
||||
"https://macgirvin.com/followers/mike",
|
||||
"https://gleasonator.com/users/macgirvin/followers"
|
||||
]
|
||||
},
|
||||
"tag":[
|
||||
{
|
||||
"type":"Mention",
|
||||
"href":"https://gleasonator.com/users/macgirvin",
|
||||
"name":"@macgirvin@gleasonator.com"
|
||||
},
|
||||
{
|
||||
"type":"Mention",
|
||||
"href":"https://gleasonator.com/users/alex",
|
||||
"name":"@alex@gleasonator.com"
|
||||
}
|
||||
],
|
||||
"to":[
|
||||
"https://www.w3.org/ns/activitystreams#Public",
|
||||
"https://gleasonator.com/users/alex",
|
||||
"https://gleasonator.com/users/macgirvin"
|
||||
],
|
||||
"cc":[
|
||||
"https://macgirvin.com/followers/mike",
|
||||
"https://gleasonator.com/users/macgirvin/followers"
|
||||
],
|
||||
"signature":{
|
||||
"type":"RsaSignature2017",
|
||||
"nonce":"544080164a412f0592f8257094a870a0177276f4a04cc4410974f5e8fa277a14",
|
||||
"creator":"https://macgirvin.com/channel/mike",
|
||||
"created":"2022-02-02T04:41:46Z",
|
||||
"signatureValue":"BkHEdRkki/DGHctiI6BWyQdn0i9ip+7rFiqqlLgotgQzwA8wzcmyvFIRm8Z+3OqrbzkNyQLCmx4qHvkqWyNrR0eSSJPaBryYvTLpLBz5F5PSpHOI5x4kRGVaI2S1Po+pUMWgchyyQ8ylqdLVHe0FnqId7vFVo9uj4jWydU5wPGlbb5nvnRMQGGyPqzCJ69lopMgCRCUNgbOz6hYVU0Mhqgi9BDjs1crbRLoGexz87tu7FeGEmtyfz8/SBGrDy+X+U3ahykwqd7ggcptsYVu5BY7BfREOLNZE8BwapUCg+QSw9PJv7dLJytdh0kUrzpuAPNbugx7y662FALmHZlxcIC1IVwbPOwEiosDm6wXsOiIyTvnNFcvDre/B1corB2yt5wmO3Cu5jINvp4+aBTheGIKMxBvpJXywpWe6C0VBqfNZSreJtDwp9lHd6D1+L4V6hUCOqiCcqmLT/GI5TOR+EhSpJ02TOkuu+/8hyIfO6ec3uK98y8suyidckbfM60jrbvZh2s/kF9WlDsE9K+Jlyd9Xx3mI5jU+4MXo1MDA57zYpsXw0S+v++rvnOw8CkQr/opVdIRSCG+UB3VRinpgjwW1UQcdAI+fiVaAwqr45MgnIEaQdk13skJUfUl06D9IxKxhu7yNW1tR621w/HN+358qVQWWBoj+1ZhCG3Thjug="
|
||||
}
|
||||
}
|
|
@ -32,4 +32,15 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNotePageValidatorTest
|
|||
%{valid?: true} = ArticleNotePageValidator.cast_and_validate(note)
|
||||
end
|
||||
end
|
||||
|
||||
test "a Note from Roadhouse validates" do
|
||||
insert(:user, ap_id: "https://macgirvin.com/channel/mike")
|
||||
|
||||
%{"object" => note} =
|
||||
"test/fixtures/roadhouse-create-activity.json"
|
||||
|> File.read!()
|
||||
|> Jason.decode!()
|
||||
|
||||
%{valid?: true} = ArticleNotePageValidator.cast_and_validate(note)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue