From dfe92a1f61d1d56246d1680442042deffa0ea76c Mon Sep 17 00:00:00 2001 From: alpaylan Date: Wed, 14 Apr 2021 01:49:24 +0300 Subject: start testing schema --- tests/schema_tests.rs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'tests/schema_tests.rs') diff --git a/tests/schema_tests.rs b/tests/schema_tests.rs index 5c28aed..8b07f72 100644 --- a/tests/schema_tests.rs +++ b/tests/schema_tests.rs @@ -1,9 +1,29 @@ #[cfg(test)] mod tests { + use gradecoin::schema::*; + use serde_json::error::Error; + use serde_test::{assert_tokens, Token}; #[test] fn claims_serialize_correctly() { - + let claims = Claims { + tha: "hashed_string".to_owned(), + iat: 0, + exp: 100, + }; + assert_tokens( + &claims, + &[ + Token::Struct{name: "Claims", len: 3}, + Token::String("tha"), + Token::String("hashed_string"), + Token::String("iat"), + Token::U64(0), + Token::String("exp"), + Token::U64(100), + Token::StructEnd, + ] + ) } #[test] -- cgit v1.2.3-70-g09d2