Initial commit: Book management system with Rust Loco backend and Vue 3 frontend
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
use book_manager::app::App;
|
||||
use loco_rs::testing::prelude::*;
|
||||
use serial_test::serial;
|
||||
|
||||
#[tokio::test]
|
||||
#[serial]
|
||||
async fn test_books_route_exists() {
|
||||
request::<App, _, _>(|request, _ctx| async move {
|
||||
// Try to access books test endpoint
|
||||
let response = request.get("/api/books/test").await;
|
||||
|
||||
println!("Status: {}", response.status_code());
|
||||
println!("Body: {}", response.text());
|
||||
|
||||
// Check if we get JSON response
|
||||
assert_eq!(response.status_code(), 200);
|
||||
let body = response.text();
|
||||
assert!(body.contains("Books controller is working"), "Got: {}", body);
|
||||
})
|
||||
.await;
|
||||
}
|
||||
Reference in New Issue
Block a user