mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-18 14:01:04 +00:00
fix: update candidate tests to new async implementations
This commit is contained in:
parent
0e510d0789
commit
1f0b9c94db
1 changed files with 5 additions and 3 deletions
|
|
@ -65,17 +65,19 @@ mod tests {
|
|||
|
||||
#[tokio::test]
|
||||
async fn test_create_candidate() {
|
||||
const SECRET: &str = "Tajny_kod";
|
||||
|
||||
let db = get_memory_sqlite_connection().await;
|
||||
|
||||
let form = serde_json::from_value(json!({
|
||||
"application": 5555555,
|
||||
})).unwrap();
|
||||
|
||||
let candidate = Mutation::create_candidate(&db, form, &"Tajny_kod".to_string()).await.unwrap();
|
||||
let candidate = Mutation::create_candidate(&db, form, &SECRET.to_string()).await.unwrap();
|
||||
|
||||
assert_eq!(candidate.application, 5555555);
|
||||
assert_ne!(candidate.code, "Tajny_kod".to_string());
|
||||
assert!(crypto::verify_password("Tajny_kod", &*candidate.code).ok().unwrap());
|
||||
assert_ne!(candidate.code, SECRET.to_string());
|
||||
assert!(crypto::verify_password(SECRET.to_string(), candidate.code).await.ok().unwrap());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue