Lines
100 %
Functions
Branches
use super::*;
use crate::model::User;
use axum::http::StatusCode;
fn auth() -> JWTAuthMiddleware {
JWTAuthMiddleware {
user: User {
id: Uuid::from_u128(1),
name: String::new(),
email: String::new(),
role: String::new(),
photo: String::new(),
verified: true,
created_at: None,
updated_at: None,
},
access_token_uuid: Uuid::from_u128(2),
refreshed: false,
}
#[tokio::test]
async fn delete_rejects_a_malformed_transaction_id() {
let err = transaction_delete_submit(Path("nope".to_string()), Extension(auth()))
.await
.map(|_| ())
.unwrap_err();
assert_eq!(err.status, StatusCode::BAD_REQUEST);
assert_eq!(err.message, "Invalid transaction ID format");