Refactor IAM tests: Remove unused repository tests, streamline service tests, and enhance validation checks for team and user services
This commit is contained in:
@@ -9,3 +9,22 @@ pub fn get_iso_date() -> String {
|
||||
info!(date_str = %date_str, "get_iso_date returning RFC3339 date string");
|
||||
date_str
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use chrono::DateTime;
|
||||
|
||||
#[test]
|
||||
fn test_get_iso_date() {
|
||||
let date_str = get_iso_date();
|
||||
// Should be valid RFC3339
|
||||
let parsed = DateTime::parse_from_rfc3339(&date_str);
|
||||
assert!(parsed.is_ok());
|
||||
// Should be recent (within last second)
|
||||
let now = Utc::now();
|
||||
let parsed = parsed.unwrap().with_timezone(&Utc);
|
||||
let diff = (now - parsed).num_milliseconds().abs();
|
||||
assert!(diff < 1000); // Within 1 second
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user