diff --git a/plume-models/src/tags.rs b/plume-models/src/tags.rs index 7631358b..c41700c9 100644 --- a/plume-models/src/tags.rs +++ b/plume-models/src/tags.rs @@ -165,6 +165,24 @@ mod tests { }); } + #[test] + fn from_activity07() { + let conn = &db(); + conn.test_transaction::<_, Error, _>(|| { + let (posts, _users, _blogs) = fill_database(conn); + let post_id = posts[0].id; + let mut ht = Hashtag07::new(); + ht.set_href(ap_url(&format!("https://plu.me/tag/a_tag")).parse::()?); + ht.set_name("a_tag".to_string()); + let tag = Tag::from_activity07(conn, &ht, post_id, true)?; + + assert_eq!(&tag.tag, "a_tag"); + assert!(tag.is_hashtag); + + Ok(()) + }); + } + #[test] fn build_activity() { let conn = &db();