()
| 246 | #[test] |
| 247 | #[wasm_bindgen_test] |
| 248 | fn encode_wrong_alg_family() { |
| 249 | let my_claims = Claims { |
| 250 | sub: "b@b.com".to_string(), |
| 251 | company: "ACME".to_string(), |
| 252 | exp: OffsetDateTime::now_utc().unix_timestamp() + 10000, |
| 253 | }; |
| 254 | let claims = encode(&Header::default(), &my_claims, &EncodingKey::from_rsa_der(b"secret")); |
| 255 | assert_eq!(claims.unwrap_err().into_kind(), ErrorKind::InvalidAlgorithm); |
| 256 | } |
| 257 | |
| 258 | #[test] |
| 259 | #[wasm_bindgen_test] |