Files
k-photos/crates/adapters/auth/tests/password.rs

11 lines
353 B
Rust

use adapters_auth::BcryptPasswordHasher;
use domain::ports::PasswordHasher;
#[tokio::test]
async fn hash_and_verify_roundtrip() {
let h = BcryptPasswordHasher;
let hash = h.hash("mysecretpassword").await.unwrap();
assert!(h.verify("mysecretpassword", &hash).await.unwrap());
assert!(!h.verify("wrongpassword", &hash).await.unwrap());
}