Add sample usage of render_errors: true assert_template_result option

This commit is contained in:
Dylan Thacker-Smith
2022-09-06 16:54:38 -04:00
parent 3a64b3741f
commit 4648f0fa64
+10 -7
View File
@@ -134,14 +134,17 @@ class RenderTagTest < Minitest::Test
end end
def test_includes_will_not_render_inside_nested_sibling_tags def test_includes_will_not_render_inside_nested_sibling_tags
Liquid::Template.file_system = StubFileSystem.new( assert_template_result(
'foo' => 'bar', "Liquid error (test_include line 1): include usage is not allowed in this context" \
'nested_render_with_sibling_include' => '{% render "test_include" %}{% include "foo" %}', "Liquid error (nested_render_with_sibling_include line 1): include usage is not allowed in this context",
'test_include' => '{% include "foo" %}' '{% render "nested_render_with_sibling_include" %}',
partials: {
'foo' => 'bar',
'nested_render_with_sibling_include' => '{% render "test_include" %}{% include "foo" %}',
'test_include' => '{% include "foo" %}',
},
render_errors: true
) )
output = Liquid::Template.parse('{% render "nested_render_with_sibling_include" %}').render
assert_equal('Liquid error: include usage is not allowed in this contextLiquid error: include usage is not allowed in this context', output)
end end
def test_render_tag_with def test_render_tag_with