]> Untitled Git - lemmy.git/blob - crates/apub/src/protocol/activities/create_or_update/mod.rs
Add lotide activities to tests
[lemmy.git] / crates / apub / src / protocol / activities / create_or_update / mod.rs
1 pub mod comment;
2 pub mod post;
3
4 #[cfg(test)]
5 mod tests {
6   use crate::{
7     objects::tests::file_to_json_object,
8     protocol::{
9       activities::create_or_update::{comment::CreateOrUpdateComment, post::CreateOrUpdatePost},
10       tests::test_parse_lemmy_item,
11     },
12   };
13
14   #[actix_rt::test]
15   async fn test_parse_create_or_update() {
16     test_parse_lemmy_item::<CreateOrUpdatePost>(
17       "assets/lemmy/activities/create_or_update/create_page.json",
18     );
19     test_parse_lemmy_item::<CreateOrUpdatePost>(
20       "assets/lemmy/activities/create_or_update/update_page.json",
21     );
22     test_parse_lemmy_item::<CreateOrUpdateComment>(
23       "assets/lemmy/activities/create_or_update/create_note.json",
24     );
25
26     file_to_json_object::<CreateOrUpdateComment>("assets/pleroma/activities/create_note.json");
27     file_to_json_object::<CreateOrUpdateComment>("assets/smithereen/activities/create_note.json");
28     file_to_json_object::<CreateOrUpdateComment>("assets/mastodon/activities/create_note.json");
29
30     file_to_json_object::<CreateOrUpdatePost>("assets/lotide/activities/create_page.json");
31     file_to_json_object::<CreateOrUpdateComment>("assets/lotide/activities/create_note_reply.json");
32   }
33 }