Skip to content

Commit

Permalink
Add a simple timestamp test
Browse files Browse the repository at this point in the history
Fixes #106
  • Loading branch information
jedisct1 committed Feb 19, 2024
1 parent ab56383 commit 12a73be
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,11 @@ fn explicitly_empty_audiences() {
let decoded = key.verify_token::<NoCustomClaims>(&token, None).unwrap();
assert!(decoded.audiences.is_none());
}

#[test]
fn simple_timestamp_test() {
use crate::prelude::*;
let json = r#"{ "iat": 200 }"#;
let claims: JWTClaims<NoCustomClaims> = serde_json::from_str(json).unwrap();
assert_eq!(claims.issued_at.unwrap().as_secs(), 200);
}

0 comments on commit 12a73be

Please sign in to comment.