Rocket/examples/hello_2018/src/tests.rs

12 lines
330 B
Rust
Raw Normal View History

use rocket;
use rocket::routes;
use rocket::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()));
}