mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
Allow render tag to recognize drops that respond to to_partial
This commit is contained in:
committed by
Guilherme Carreiro
parent
0cc6cdd553
commit
db350c54ff
@@ -101,10 +101,11 @@ class RenderTagTest < Minitest::Test
|
||||
end
|
||||
end
|
||||
|
||||
def test_dynamically_choosen_templates_are_not_allowed
|
||||
assert_raises(::ArgumentError) do
|
||||
def test_dynamically_chosen_templates_are_not_allowed
|
||||
error = assert_raises(::ArgumentError) do
|
||||
Template.parse('{% assign name = "snippet" %}{% render name %}').render!
|
||||
end
|
||||
assert_equal("Argument error in tag 'render' - Dynamically chosen templates are not allowed", error.message)
|
||||
end
|
||||
|
||||
def test_rigid_parsing_errors
|
||||
@@ -296,6 +297,13 @@ class RenderTagTest < Minitest::Test
|
||||
)
|
||||
end
|
||||
|
||||
def test_render_tag_with_snippet_drop
|
||||
assert_template_result(
|
||||
"Hello from snippet",
|
||||
"{% snippet my_snippet %}Hello from snippet{% endsnippet %}{% render my_snippet %}",
|
||||
)
|
||||
end
|
||||
|
||||
def test_render_tag_renders_error_with_template_name
|
||||
assert_template_result(
|
||||
'Liquid error (foo line 1): standard error',
|
||||
|
||||
Reference in New Issue
Block a user