Rocket/examples/hello_2018/src/tests.rs

10 lines
314 B
Rust
Raw Normal View History

2018-09-17 03:28:24 +00:00
use rocket::{self, routes, local::Client};
#[test]
fn hello_world() {
let rocket = rocket::ignite().mount("/", routes![super::hello]);
let client = Client::new(rocket).unwrap();
let mut response = client.get("/").dispatch();
assert_eq!(response.body_string(), Some("Hello, Rust 2018!".into()));
}