mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
mam: Fix test on serialisation
This commit is contained in:
parent
8d41959497
commit
3a2027411e
1 changed files with 5 additions and 17 deletions
|
@ -391,21 +391,9 @@ mod tests {
|
||||||
assert_eq!(elem, elem2);
|
assert_eq!(elem, elem2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[ignore]
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_serialize_query_with() {
|
fn test_serialize_query_with() {
|
||||||
let elem: Element = r#"
|
let reference: Element = "<query xmlns='urn:xmpp:mam:2'><x xmlns='jabber:x:data' type='submit'><field xmlns='jabber:x:data' var='FORM_TYPE' type='hidden'><value xmlns='jabber:x:data'>urn:xmpp:mam:2</value></field><field xmlns='jabber:x:data' var='with'><value xmlns='jabber:x:data'>juliet@capulet.lit</value></field></x></query>"
|
||||||
<query xmlns='urn:xmpp:mam:2'>
|
|
||||||
<x xmlns='jabber:x:data' type='submit'>
|
|
||||||
<field var='FORM_TYPE' type='hidden'>
|
|
||||||
<value>urn:xmpp:mam:2</value>
|
|
||||||
</field>
|
|
||||||
<field var='with'>
|
|
||||||
<value>juliet@capulet.lit</value>
|
|
||||||
</field>
|
|
||||||
</x>
|
|
||||||
</query>
|
|
||||||
"#
|
|
||||||
.parse()
|
.parse()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
@ -415,10 +403,10 @@ mod tests {
|
||||||
title: None,
|
title: None,
|
||||||
instructions: None,
|
instructions: None,
|
||||||
fields: vec![Field {
|
fields: vec![Field {
|
||||||
var: String::from("var"),
|
var: String::from("with"),
|
||||||
type_: FieldType::TextSingle,
|
type_: FieldType::TextSingle,
|
||||||
label: None,
|
label: None,
|
||||||
required: true,
|
required: false,
|
||||||
options: vec![],
|
options: vec![],
|
||||||
values: vec![String::from("juliet@capulet.lit")],
|
values: vec![String::from("juliet@capulet.lit")],
|
||||||
media: vec![],
|
media: vec![],
|
||||||
|
@ -430,7 +418,7 @@ mod tests {
|
||||||
set: None,
|
set: None,
|
||||||
form: Some(form),
|
form: Some(form),
|
||||||
};
|
};
|
||||||
let elem2 = foo.into();
|
let serialized: Element = foo.into();
|
||||||
assert_eq!(elem, elem2);
|
assert_eq!(serialized, reference);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue