mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
Add more unit tests
This commit is contained in:
@@ -29,11 +29,11 @@ class SnippetTest < Minitest::Test
|
||||
|
||||
def test_render_inline_snippet
|
||||
template = <<~LIQUID.strip
|
||||
{% snippet "input" %}
|
||||
{% snippet "hey" %}
|
||||
Hey
|
||||
{% endsnippet %}
|
||||
|
||||
{%- render "input" -%}
|
||||
{%- render "hey" -%}
|
||||
LIQUID
|
||||
expected = <<~OUTPUT
|
||||
|
||||
@@ -42,4 +42,33 @@ class SnippetTest < Minitest::Test
|
||||
|
||||
assert_template_result(expected, template)
|
||||
end
|
||||
|
||||
def test_render_multiple_inline_snippets
|
||||
template = <<~LIQUID.strip
|
||||
{% snippet "input" %}
|
||||
<input />
|
||||
{% endsnippet %}
|
||||
|
||||
{% snippet "banner" %}
|
||||
<marquee direction="up" height="100px">
|
||||
Welcome to my store!
|
||||
</marquee>
|
||||
{% endsnippet %}
|
||||
|
||||
{%- render "input" -%}
|
||||
{%- render "banner" -%}
|
||||
LIQUID
|
||||
expected = <<~OUTPUT
|
||||
|
||||
|
||||
|
||||
<input />
|
||||
|
||||
<marquee direction="up" height="100px">
|
||||
Welcome to my store!
|
||||
</marquee>
|
||||
OUTPUT
|
||||
|
||||
assert_template_result(expected, template)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user