We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 84e0024 commit 2e5a198Copy full SHA for 2e5a198
src/main.rs
@@ -10,3 +10,20 @@ fn health_check() {
10
fn rocket() -> _ {
11
rocket::build().mount("/", routes![health_check])
12
}
13
+
14
+#[cfg(test)]
15
+mod test {
16
+ use super::rocket;
17
+ use rocket::http::Status;
18
+ use rocket::local::blocking::Client;
19
+ use std::io::Read;
20
21
+ #[test]
22
+ fn test_hello() {
23
+ let client = Client::tracked(rocket()).expect("Failed to create client");
24
+ let response = client.get(uri!(super::health_check)).dispatch();
25
26
+ assert_eq!(response.status(), Status::Ok);
27
+ assert_eq!(response.bytes().count(), 0);
28
+ }
29
+}
0 commit comments