You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
652 B

  1. use crate::common;
  2. use actix_demo::get_build_info;
  3. #[cfg(test)]
  4. mod tests {
  5. use super::*;
  6. use actix_web::dev::Service as _;
  7. use actix_web::http::StatusCode;
  8. use actix_web::test;
  9. #[actix_rt::test]
  10. async fn get_build_info_should_succeed() {
  11. let req = test::TestRequest::get().uri("/api/build-info").to_request();
  12. let resp = common::test_app().await.unwrap().call(req).await.unwrap();
  13. assert_eq!(resp.status(), StatusCode::OK);
  14. let body: build_info::BuildInfo = test::read_body_json(resp).await;
  15. let _ = tracing::debug!("{:?}", body);
  16. assert_eq!(body, *get_build_info());
  17. }
  18. }