add proper test for stringify helper

This commit is contained in:
Adrian Malacoda 2018-08-05 00:09:06 -05:00
parent 5f89f143d1
commit 719f9f1441

View File

@ -28,12 +28,16 @@ mod tests {
let mut handlebars = Handlebars::new(); let mut handlebars = Handlebars::new();
register(&mut handlebars); register(&mut handlebars);
println!("{:?}", handlebars.render_template("{{JSONstringify foo}}", &json!({ let foo = json!({
"foo": { "bar": 1,
"bar": 1, "baz": 2
"baz": 2 });
} assert_eq!(
})).unwrap()); handlebars.render_template("{{JSONstringify foo}}", &json!({
"foo": foo
})).unwrap(),
foo.to_string()
);
} }
#[test] #[test]