mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
Prevent an internal error in include tag from non-string template_name
which would otherwise happen on `template_name.split('/')`
This commit is contained in:
@@ -249,6 +249,11 @@ class IncludeTagTest < Minitest::Test
|
||||
"{% include nil %}", render_errors: true)
|
||||
end
|
||||
|
||||
def test_render_raise_argument_error_when_template_is_not_a_string
|
||||
assert_template_result("Liquid error (line 1): Argument error in tag 'include' - Illegal template name",
|
||||
"{% include 123 %}", render_errors: true)
|
||||
end
|
||||
|
||||
def test_including_via_variable_value
|
||||
assert_template_result("from TestFileSystem", "{% assign page = 'pick_a_source' %}{% include page %}",
|
||||
partials: { "pick_a_source" => "from TestFileSystem" })
|
||||
|
||||
Reference in New Issue
Block a user