diff options
| author | Pjotr Prins <pjotr.public01@thebird.nl> | 2026-10-01 16:57:48 +0200 |
|---|---|---|
| committer | Pjotr Prins <pjotr.public01@thebird.nl> | 2026-10-01 16:57:48 +0200 |
| commit | b6374cf8d80c161cfed761d4c97eff320f311539 (patch) | |
| tree | e8189619ad397a5da116e8296c1b74205808a7e1 /tests | |
| parent | 093c81ba42be704a73dad0193d901e4e3c878ace (diff) | |
| download | genenetwork4-b6374cf8d80c161cfed761d4c97eff320f311539.tar.gz | |
Move tests out
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/hello_world.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/hello_world.rs b/tests/hello_world.rs new file mode 100644 index 0000000..112a3c0 --- /dev/null +++ b/tests/hello_world.rs @@ -0,0 +1,17 @@ +use axum::body::Body; +use axum::http::{Request, StatusCode}; +use http_body_util::BodyExt; +use tower::ServiceExt; + +#[tokio::test] +async fn hello_world_returns_ok_with_greeting() { + let response = genenetwork4::app() + .oneshot(Request::builder().uri("/").body(Body::empty()).unwrap()) + .await + .unwrap(); + + assert_eq!(response.status(), StatusCode::OK); + + let body = response.into_body().collect().await.unwrap().to_bytes(); + assert_eq!(&body[..], b"Hello, world!"); +} |
