From 7002578bc0a651e29eea5bd07a6472e8507f0149 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 23 Apr 2017 03:22:25 +0100 Subject: [PATCH] body: Test the serialise function. --- src/body.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/body.rs b/src/body.rs index f170cd38..7703d655 100644 --- a/src/body.rs +++ b/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)); + } }