Skip to content

Commit

Permalink
Add more unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karreiro committed Sep 20, 2024
1 parent b397513 commit d7045f9
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions test/integration/tags/snippet_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ def test_invalid_inline_snippet

def test_render_inline_snippet
template = <<~LIQUID.strip
{% snippet "input" %}
{% snippet "hey" %}
Hey
{% endsnippet %}
{%- render "input" -%}
{%- render "hey" -%}
LIQUID
expected = <<~OUTPUT
Expand All @@ -42,4 +42,33 @@ def test_render_inline_snippet

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

0 comments on commit d7045f9

Please sign in to comment.