diff --git a/ruma-events/tests/state_event.rs b/ruma-events/tests/state_event.rs index 7e44edfa..bec640fe 100644 --- a/ruma-events/tests/state_event.rs +++ b/ruma-events/tests/state_event.rs @@ -182,6 +182,11 @@ fn deserialize_avatar_without_prev_content() { "type": "m.room.avatar" }); + let expected_url = "http://www.matrix.org"; + + #[cfg(feature = "unstable-pre-spec")] + let expected_url = Some(expected_url.to_owned()); + assert_matches!( from_json_value::>>(json_data) .unwrap() @@ -233,7 +238,7 @@ fn deserialize_avatar_without_prev_content() { && *thumbnail_url == "mxc://matrix.org" ) ) - && url == "http://www.matrix.org" + && url == expected_url && unsigned.is_empty() ); } diff --git a/ruma-events/tests/stripped.rs b/ruma-events/tests/stripped.rs index 2f1a9b26..f572a5e3 100644 --- a/ruma-events/tests/stripped.rs +++ b/ruma-events/tests/stripped.rs @@ -117,13 +117,17 @@ fn deserialize_stripped_state_events() { match event { AnyStrippedStateEvent::RoomAvatar(event) => { let image_info = event.content.info.unwrap(); + let expected_url = "https://example.com/image.jpg"; + + #[cfg(feature = "unstable-pre-spec")] + let expected_url = Some(expected_url.to_owned()); assert_eq!(image_info.height.unwrap(), uint!(128)); assert_eq!(image_info.width.unwrap(), uint!(128)); assert_eq!(image_info.mimetype.unwrap(), "image/jpeg"); assert_eq!(image_info.size.unwrap(), uint!(1024)); assert_eq!(image_info.thumbnail_info.unwrap().size.unwrap(), uint!(32)); - assert_eq!(event.content.url, "https://example.com/image.jpg"); + assert_eq!(event.content.url, expected_url); assert_eq!(event.state_key, ""); assert_eq!(event.sender.to_string(), "@example:localhost"); }