chore: reorganize project into monorepo
This commit is contained in:
19
backend/tests/requests/category.rs
Normal file
19
backend/tests/requests/category.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
use loco_rs::testing::prelude::*;
|
||||
use serial_test::serial;
|
||||
use termi_api::app::App;
|
||||
|
||||
#[tokio::test]
|
||||
#[serial]
|
||||
async fn can_get_categories() {
|
||||
request::<App, _, _>(|request, ctx| async move {
|
||||
seed::<App>(&ctx).await.unwrap();
|
||||
|
||||
let res = request.get("/api/categories/").await;
|
||||
assert_eq!(res.status_code(), 200);
|
||||
|
||||
let body = res.text();
|
||||
assert!(body.contains("\"name\":\"tech\""));
|
||||
assert!(body.contains("\"count\":3"));
|
||||
})
|
||||
.await;
|
||||
}
|
||||
Reference in New Issue
Block a user