From 5060aef6f931e10286591c210e2a89b95d7ee0a0 Mon Sep 17 00:00:00 2001 From: alpaylan Date: Wed, 14 Apr 2021 01:53:30 +0300 Subject: finished claim testing. --- tests/schema_tests.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tests/schema_tests.rs') diff --git a/tests/schema_tests.rs b/tests/schema_tests.rs index 8b07f72..c6fae9d 100644 --- a/tests/schema_tests.rs +++ b/tests/schema_tests.rs @@ -28,7 +28,14 @@ mod tests { #[test] fn claims_deserialize_correctly() { - + let data = r#"{"tha":"hashed_string","iat":0,"exp":100}"#; + let claims: Claims = serde_json::from_str(data).unwrap(); + let expected_claims = Claims { + tha: "hashed_string".to_owned(), + iat: 0, + exp: 100, + }; + assert_eq!(claims, expected_claims); } #[test] -- cgit v1.2.3-70-g09d2