--- /dev/null
+{
+ "@context": [
+ "https://www.w3.org/ns/activitystreams",
+ "https://mycrowd.ca/schemas/litepub-0.1.jsonld",
+ {
+ "@language": "und"
+ }
+ ],
+ "actor": "https://mycrowd.ca/users/kinetix",
+ "cc": [],
+ "id": "https://mycrowd.ca/activities/dab6a4d3-0db0-41ee-8aab-7bfa4929b4fd",
+ "object": "https://lemmy.ca/u/kinetix",
+ "state": "pending",
+ "to": [
+ "https://lemmy.ca/u/kinetix"
+ ],
+ "type": "Follow"
+}
#[cfg(test)]
mod tests {
use crate::{
+ context::WithContext,
objects::tests::file_to_json_object,
protocol::{
activities::create_or_update::{comment::CreateOrUpdateComment, post::CreateOrUpdatePost},
"assets/lemmy/activities/create_or_update/create_note.json",
);
- file_to_json_object::<CreateOrUpdateComment>("assets/pleroma/activities/create_note.json");
- file_to_json_object::<CreateOrUpdateComment>("assets/smithereen/activities/create_note.json");
+ file_to_json_object::<WithContext<CreateOrUpdateComment>>(
+ "assets/pleroma/activities/create_note.json",
+ );
+ file_to_json_object::<WithContext<CreateOrUpdateComment>>(
+ "assets/smithereen/activities/create_note.json",
+ );
file_to_json_object::<CreateOrUpdateComment>("assets/mastodon/activities/create_note.json");
file_to_json_object::<CreateOrUpdatePost>("assets/lotide/activities/create_page.json");
#[cfg(test)]
mod tests {
- use crate::protocol::{
- activities::following::{
- accept::AcceptFollowCommunity,
- follow::FollowCommunity,
- undo_follow::UndoFollowCommunity,
+ use crate::{
+ context::WithContext,
+ objects::tests::file_to_json_object,
+ protocol::{
+ activities::following::{
+ accept::AcceptFollowCommunity,
+ follow::FollowCommunity,
+ undo_follow::UndoFollowCommunity,
+ },
+ tests::test_parse_lemmy_item,
},
- tests::test_parse_lemmy_item,
};
#[actix_rt::test]
test_parse_lemmy_item::<UndoFollowCommunity>(
"assets/lemmy/activities/following/undo_follow.json",
);
+
+ file_to_json_object::<WithContext<FollowCommunity>>("assets/pleroma/activities/follow.json");
}
}
#[cfg(test)]
mod tests {
use crate::{
+ context::WithContext,
objects::tests::file_to_json_object,
protocol::{
objects::{chat_message::ChatMessage, group::Group, note::Note, page::Page, person::Person},
test_parse_lemmy_item::<Note>("assets/lemmy/objects/note.json");
test_parse_lemmy_item::<ChatMessage>("assets/lemmy/objects/chat_message.json");
- file_to_json_object::<Person>("assets/pleroma/objects/person.json");
- file_to_json_object::<Note>("assets/pleroma/objects/note.json");
- file_to_json_object::<ChatMessage>("assets/pleroma/objects/chat_message.json");
+ file_to_json_object::<WithContext<Person>>("assets/pleroma/objects/person.json");
+ file_to_json_object::<WithContext<Note>>("assets/pleroma/objects/note.json");
+ file_to_json_object::<WithContext<ChatMessage>>("assets/pleroma/objects/chat_message.json");
- file_to_json_object::<Person>("assets/smithereen/objects/person.json");
+ file_to_json_object::<WithContext<Person>>("assets/smithereen/objects/person.json");
file_to_json_object::<Note>("assets/smithereen/objects/note.json");
file_to_json_object::<Person>("assets/mastodon/objects/person.json");