()
| 81 | |
| 82 | #[actix_web::test] |
| 83 | async fn api_versioning() { |
| 84 | let app = test::init_service(create_app()).await; |
| 85 | |
| 86 | let req = TestRequest::with_uri("/api/hello").insert_header(("Accept-Version", "1")); |
| 87 | let res = test::call_and_read_body(&app, req.to_request()).await; |
| 88 | assert_eq!(res, "Hello World from v1 API!"); |
| 89 | |
| 90 | let req = TestRequest::with_uri("/api/hello").insert_header(("Accept-Version", "2")); |
| 91 | let res = test::call_and_read_body(&app, req.to_request()).await; |
| 92 | assert_eq!(res, "Hello World from the awesome new v2 API!"); |
| 93 | } |
| 94 | } |
nothing calls this directly
no test coverage detected