18 lines
No EOL
521 B
Rust
18 lines
No EOL
521 B
Rust
#[tokio::test]
|
|
async fn test_hello_route() {
|
|
use axum_test::TestServer;
|
|
use server::server::create_app;
|
|
|
|
// Create a TestServer with your application
|
|
let app = create_app().await;
|
|
let server = TestServer::new(app).unwrap();
|
|
|
|
// Make a request to the `/hello` route
|
|
let response = server.get("/").await;
|
|
|
|
// Assert that the status code is OK (200)
|
|
response.assert_status_ok();
|
|
|
|
// Assert that the response body contains the expected text
|
|
response.assert_text("Hello, World!");
|
|
} |