Default to template name

This commit is contained in:
Mike Angell
2019-10-08 06:37:16 +11:00
parent e6a6d2e813
commit efaec29fa6
3 changed files with 13 additions and 23 deletions

View File

@@ -166,17 +166,17 @@ class RenderTagTest < Minitest::Test
assert_template_result('include usage is not allowed in this contextinclude usage is not allowed in this context', '{% render "nested_render_with_sibling_include" %}')
end
def test_include_tag_with
def test_render_tag_with
Liquid::Template.file_system = StubFileSystem.new(
'product' => "Product: {{ this.title }} ",
'product_alias' => "Product: {{ this.title }} ",
'product' => "Product: {{ product.title }} ",
'product_alias' => "Product: {{ product.title }} ",
)
assert_template_result("Product: Draft 151cm ",
"{% render 'product' with products[0] %}", "products" => [{ 'title' => 'Draft 151cm' }, { 'title' => 'Element 155cm' }])
end
def test_include_tag_with_alias
def test_render_tag_with_alias
Liquid::Template.file_system = StubFileSystem.new(
'product' => "Product: {{ product.title }} ",
'product_alias' => "Product: {{ product.title }} ",
@@ -186,7 +186,7 @@ class RenderTagTest < Minitest::Test
"{% render 'product_alias' with products[0] as product %}", "products" => [{ 'title' => 'Draft 151cm' }, { 'title' => 'Element 155cm' }])
end
def test_include_tag_for_alias
def test_render_tag_for_alias
Liquid::Template.file_system = StubFileSystem.new(
'product' => "Product: {{ product.title }} ",
'product_alias' => "Product: {{ product.title }} ",
@@ -196,20 +196,10 @@ class RenderTagTest < Minitest::Test
"{% render 'product_alias' for products as product %}", "products" => [{ 'title' => 'Draft 151cm' }, { 'title' => 'Element 155cm' }])
end
def test_include_tag_with_default_name
def test_render_tag_for
Liquid::Template.file_system = StubFileSystem.new(
'product' => "Product: {{ this.title }} ",
'product_alias' => "Product: {{ this.title }} ",
)
assert_template_result("Product: Draft 151cm ",
"{% render 'product' %}", "product" => { 'title' => 'Draft 151cm' })
end
def test_include_tag_for
Liquid::Template.file_system = StubFileSystem.new(
'product' => "Product: {{ this.title }} ",
'product_alias' => "Product: {{ this.title }} ",
'product' => "Product: {{ product.title }} ",
'product_alias' => "Product: {{ product.title }} ",
)
assert_template_result("Product: Draft 151cm Product: Element 155cm ",