From d7045f9d648ab54a6a1acda5200057634cb0815b Mon Sep 17 00:00:00 2001 From: Guilherme Carreiro Date: Fri, 20 Sep 2024 11:28:00 +0200 Subject: [PATCH] Add more unit tests --- test/integration/tags/snippet_test.rb | 33 +++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/test/integration/tags/snippet_test.rb b/test/integration/tags/snippet_test.rb index 7db4bafe..9844fd6e 100644 --- a/test/integration/tags/snippet_test.rb +++ b/test/integration/tags/snippet_test.rb @@ -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" %} + + {% endsnippet %} + + {% snippet "banner" %} + + Welcome to my store! + + {% endsnippet %} + + {%- render "input" -%} + {%- render "banner" -%} + LIQUID + expected = <<~OUTPUT + + + + + + + Welcome to my store! + + OUTPUT + + assert_template_result(expected, template) + end end