mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-17 01:40:42 -07:00
Add sample usage of render_errors: true assert_template_result option
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user