From aeac47cee0e14b9fa38c01082876667f0ec8d874 Mon Sep 17 00:00:00 2001 From: Bastien Orivel Date: Fri, 25 Aug 2017 13:28:43 +0200 Subject: Add test for parent default block implementations --- testing/templates/base.html | 1 + testing/tests/inheritance.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/testing/templates/base.html b/testing/templates/base.html index a588223..2b4f94f 100644 --- a/testing/templates/base.html +++ b/testing/templates/base.html @@ -1,3 +1,4 @@ {{ title }} {% block content %}{% endblock %} +{% block foo %}Foo{% endblock %} Copyright 2017 diff --git a/testing/tests/inheritance.rs b/testing/tests/inheritance.rs index ca267e1..e9ea9a2 100644 --- a/testing/tests/inheritance.rs +++ b/testing/tests/inheritance.rs @@ -18,11 +18,11 @@ struct ChildTemplate<'a> { #[test] fn test_use_base_directly() { let t = BaseTemplate { title: "Foo" }; - assert_eq!(t.render().unwrap(), "Foo\n\nCopyright 2017"); + assert_eq!(t.render().unwrap(), "Foo\n\nFoo\nCopyright 2017"); } #[test] fn test_simple_extends() { let t = ChildTemplate { _parent: BaseTemplate { title: "Bar" } }; - assert_eq!(t.render().unwrap(), "Bar\n(Bar) Content goes here\nCopyright 2017"); + assert_eq!(t.render().unwrap(), "Bar\n(Bar) Content goes here\nFoo\nCopyright 2017"); } -- cgit