body: Test the serialise function.

Emmanuel Gil Peyrot created

Change summary

src/body.rs | 8 ++++++++
1 file changed, 8 insertions(+)

Detailed changes

src/body.rs 🔗

@@ -29,6 +29,7 @@ mod tests {
     use minidom::Element;
     use error::Error;
     use body;
+    use ns;
 
     #[test]
     fn test_simple() {
@@ -69,4 +70,11 @@ mod tests {
         };
         assert_eq!(message, "Unknown attribute in body element.");
     }
+
+    #[test]
+    fn test_serialise() {
+        let body = body::Body::from("Hello world!");
+        let elem = body::serialise(&body);
+        assert!(elem.is("body", ns::JABBER_CLIENT));
+    }
 }