()
| 121 | |
| 122 | #[tokio::test] |
| 123 | async fn post_questions_auth() { |
| 124 | // SAFETY: This test runs single-threaded; no other threads access env vars. |
| 125 | unsafe { env::set_var("PASETO_KEY", "RANDOM WORDS WINTER MACINTOSH PC") }; |
| 126 | let token = issue_token(AccountId(3)); |
| 127 | |
| 128 | let filter = auth(); |
| 129 | |
| 130 | let res = warp::test::request() |
| 131 | .header("Authorization", token) |
| 132 | .filter(&filter); |
| 133 | |
| 134 | assert_eq!(res.await.unwrap().account_id, AccountId(3)); |
| 135 | } |
| 136 | } |
nothing calls this directly
no test coverage detected