Skip to content

Commit

Permalink
Test parse_json variant match, not string
Browse files Browse the repository at this point in the history
  • Loading branch information
DanGould committed Jan 7, 2025
1 parent 27f4cb9 commit 1a2273f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions payjoin/src/send/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,10 @@ mod tests {
_ => panic!("Expected WellKnown error"),
};
let unrecognized_error = r#"{"errorCode":"random", "message":"random"}"#;
assert_eq!(
ResponseError::parse(unrecognized_error).to_string(),
"The receiver sent an unrecognized error."
);
assert!(matches!(
ResponseError::parse(unrecognized_error),
ResponseError::Unrecognized { .. }
));
let invalid_json_error = json!({
"err": "random",
"message": "This version of payjoin is not supported."
Expand Down

0 comments on commit 1a2273f

Please sign in to comment.