From e2baed9a6d2844bed9dfb35dbccbc0f485ae4366 Mon Sep 17 00:00:00 2001 From: Colin Reeder Date: Thu, 2 Dec 2021 21:53:16 -0700 Subject: [PATCH] Add lotide activities to tests --- .../lotide/activities/create_note_reply.json | 30 +++++++++++++++++++ .../assets/lotide/activities/create_page.json | 20 +++++++++++++ .../activities/create_or_update/mod.rs | 3 ++ 3 files changed, 53 insertions(+) create mode 100644 crates/apub/assets/lotide/activities/create_note_reply.json create mode 100644 crates/apub/assets/lotide/activities/create_page.json diff --git a/crates/apub/assets/lotide/activities/create_note_reply.json b/crates/apub/assets/lotide/activities/create_note_reply.json new file mode 100644 index 00000000..b6b2a13f --- /dev/null +++ b/crates/apub/assets/lotide/activities/create_note_reply.json @@ -0,0 +1,30 @@ +{ + "actor": "https://c.tide.tk/users/1", + "object": { + "@context": "https://www.w3.org/ns/activitystreams", + "id": "https://c.tide.tk/comments/52", + "type": "Note", + "mediaType": "text/html", + "source": { + "content": "test comment", + "mediaType": "text/markdown" + }, + "attributedTo": "https://c.tide.tk/users/1", + "content": "

test comment

\n", + "published": "2021-09-16T01:20:27.558063+00:00", + "inReplyTo": "https://c.tide.tk/posts/51", + "to": "https://c.tide.tk/users/1", + "cc": [ + "https://www.w3.org/ns/activitystreams#Public", + "https://c.tide.tk/communities/1" + ] + }, + "to": "https://c.tide.tk/users/1", + "cc": [ + "https://www.w3.org/ns/activitystreams#Public", + "https://c.tide.tk/communities/1" + ], + "@context": "https://www.w3.org/ns/activitystreams", + "id": "https://c.tide.tk/comments/52/create", + "type": "Create" +} diff --git a/crates/apub/assets/lotide/activities/create_page.json b/crates/apub/assets/lotide/activities/create_page.json new file mode 100644 index 00000000..d39e4255 --- /dev/null +++ b/crates/apub/assets/lotide/activities/create_page.json @@ -0,0 +1,20 @@ +{ + "actor": "https://b.tide.tk/apub/users/1", + "object": { + "@context": "https://www.w3.org/ns/activitystreams", + "id": "https://b.tide.tk/apub/posts/60", + "type": "Page", + "name": "test post from b", + "summary": "test post from b", + "to": "https://c.tide.tk/communities/1", + "cc": "https://www.w3.org/ns/activitystreams#Public", + "published": "2020-12-19T19:20:26.941381+00:00", + "attributedTo": "https://b.tide.tk/apub/users/1", + "url": "https://blog.twitter.com/engineering/en_us/a/2010/announcing-snowflake.html" + }, + "to": "https://c.tide.tk/communities/1", + "cc": "https://www.w3.org/ns/activitystreams#Public", + "@context": "https://www.w3.org/ns/activitystreams", + "id": "https://b.tide.tk/apub/posts/60/create", + "type": "Create" +} diff --git a/crates/apub/src/protocol/activities/create_or_update/mod.rs b/crates/apub/src/protocol/activities/create_or_update/mod.rs index 6506c283..63ddcf96 100644 --- a/crates/apub/src/protocol/activities/create_or_update/mod.rs +++ b/crates/apub/src/protocol/activities/create_or_update/mod.rs @@ -26,5 +26,8 @@ mod tests { file_to_json_object::("assets/pleroma/activities/create_note.json"); file_to_json_object::("assets/smithereen/activities/create_note.json"); file_to_json_object::("assets/mastodon/activities/create_note.json"); + + file_to_json_object::("assets/lotide/activities/create_page.json"); + file_to_json_object::("assets/lotide/activities/create_note_reply.json"); } } -- 2.44.1