aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/simple.rs
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-05-26 11:45:18 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-05-26 11:45:27 +0200
commitce84543b69b69ab2030ce4daeae3f26d5008b11d (patch)
tree461f0d4d7fd92551a3eda5306cbd5b50ec68ca47 /testing/tests/simple.rs
parent71d99927a63bc406023484ab21f885cd985c9a88 (diff)
downloadaskama-ce84543b69b69ab2030ce4daeae3f26d5008b11d.tar.gz
askama-ce84543b69b69ab2030ce4daeae3f26d5008b11d.tar.bz2
askama-ce84543b69b69ab2030ce4daeae3f26d5008b11d.zip
Add test for basic chained attributes
Diffstat (limited to 'testing/tests/simple.rs')
-rw-r--r--testing/tests/simple.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs
index a04b3fa..980321f 100644
--- a/testing/tests/simple.rs
+++ b/testing/tests/simple.rs
@@ -93,6 +93,25 @@ fn test_attr() {
}
+struct NestedHolder {
+ holder: Holder,
+}
+
+#[derive(Template)]
+#[template(path = "nested-attr.html")]
+struct NestedAttrTemplate {
+ inner: NestedHolder,
+}
+
+#[test]
+fn test_nested_attr() {
+ let t = NestedAttrTemplate {
+ inner: NestedHolder { holder: Holder { a: 5 } }
+ };
+ assert_eq!(t.render(), "5");
+}
+
+
#[derive(Template)]
#[template(path = "option.html")]
struct OptionTemplate<'a> {