From 25ef0df671079d3cc90382ff06aca09080769b14 Mon Sep 17 00:00:00 2001 From: Justin Li Date: Mon, 11 May 2015 17:59:05 -0400 Subject: [PATCH] Add tests for #461 --- test/integration/tags/include_tag_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/integration/tags/include_tag_test.rb b/test/integration/tags/include_tag_test.rb index 5a8dc5b..32f2f5c 100644 --- a/test/integration/tags/include_tag_test.rb +++ b/test/integration/tags/include_tag_test.rb @@ -219,4 +219,12 @@ class IncludeTagTest < Minitest::Test assert_equal 'x', Template.parse("{% include template %}", error_mode: :strict, include_options_blacklist: [:error_mode]).render!("template" => '{{ "X" || downcase }}') end end + + def test_including_via_variable_value + assert_template_result "from TestFileSystem", "{% assign page = 'pick_a_source' %}{% include page %}" + + assert_template_result "Product: Draft 151cm ", "{% assign page = 'product' %}{% include page %}", "product" => {'title' => 'Draft 151cm'} + + assert_template_result "Product: Draft 151cm ", "{% assign page = 'product' %}{% include page for foo %}", "foo" => {'title' => 'Draft 151cm'} + end end # IncludeTagTest