ibis/tests/test.rs

23 lines
554 B
Rust
Raw Normal View History

2023-11-15 12:05:07 +00:00
extern crate fediwiki;
use fediwiki::federation::objects::article::DbArticle;
use fediwiki::start;
#[tokio::test]
async fn test_get_article() {
let hostname = "localhost:8131";
let join = tokio::task::spawn(async {
start(hostname).await.unwrap();
});
let title = "Manu_Chao";
let res: DbArticle = reqwest::get(format!("http://{hostname}/api/v1/article/{title}"))
.await
.unwrap()
.json()
.await
.unwrap();
assert_eq!(title, res.title);
assert!(res.local);
join.abort();
}