mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-12-23 18:40:34 +00:00
Add test for Tag::from_activity07()
This commit is contained in:
parent
28440271bb
commit
c4bb1f771b
1 changed files with 18 additions and 0 deletions
|
@ -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::<IriString>()?);
|
||||||
|
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]
|
#[test]
|
||||||
fn build_activity() {
|
fn build_activity() {
|
||||||
let conn = &db();
|
let conn = &db();
|
||||||
|
|
Loading…
Reference in a new issue