pulled out tests and validated them
This commit is contained in:
1 parent
dc8d62da30
commit
435a54a02d
67 files changed
+6927
-6957
No files matched your search
+2
-18
@@ -36,21 +36,5 @@ pub(crate) async fn ping() -> Json<serde_json::Value> {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use axum::http::StatusCode;
|
||||
|
||||
use crate::api::router;
|
||||
use crate::api::testutil::{get, json};
|
||||
use crate::config::Config;
|
||||
use crate::sources::fake::fake_state;
|
||||
|
||||
#[tokio::test]
|
||||
async fn ping_reports_version() {
|
||||
let app = router(fake_state(Config::default()));
|
||||
let (status, body) = get(&app, "/ping").await;
|
||||
assert_eq!(status, StatusCode::OK);
|
||||
let v = json(&body);
|
||||
assert_eq!(v["status"], "ok");
|
||||
assert_eq!(v["version"], env!("CARGO_PKG_VERSION"));
|
||||
}
|
||||
}
|
||||
#[path = "ping_tests.rs"]
|
||||
mod tests;
|
||||
Reference in new issue
Block a user