Skip to content

Commit 1b6bb50

Browse files
committed
refactor: Move test code to 'tests' folder
1 parent d3af9da commit 1b6bb50

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/health_check.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#[macro_use]
2+
extern crate rocket;
3+
4+
use rocket::http::Status;
5+
use rocket::local::blocking::Client;
6+
use rocket::{Build, Rocket};
7+
use std::io::Read;
8+
9+
fn spawn_app() -> Rocket<Build> {
10+
bibimbap_backend::run()
11+
}
12+
13+
#[test]
14+
fn health_check_works() {
15+
let client = Client::tracked(spawn_app()).expect("Failed to create client");
16+
let response = client.get(uri!("/health_check")).dispatch();
17+
18+
assert_eq!(response.status(), Status::Ok);
19+
assert_eq!(response.bytes().count(), 0);
20+
}

0 commit comments

Comments
 (0)