# This is totally a unit test, but it's much more informative to read # this in cuke form. Feature: Liquid Tags A number of custom liquid tags are made available to the page and theme bodies, enabling generation of HTML tags, referencing assets, etc. Background: Given the asset URI prefix is "https://landable.dev/_assets" And a page under test And these assets: | name | description | | panda | Baz! | | cthulhu | Wisconsin Disclosures | | small | Site Favicon | Scenario: title_tag Given the page's body is "{% title_tag %}" Then the rendered content should be: """ Page Under Test """ Scenario: meta_tags Given the page's body is "{% meta_tags %}" And the page's meta tags are: | name | content | | robots | noindex,nofollow | | keywords | momoney,moproblems | Then the rendered content should be: """ """ Scenario: head_content Given the page's body is "{% head_content %}" And the page's head tag is "" Then the rendered content should be: """ """ Scenario: head Given the page's body is "{% head %}" And the page's head tag is "" And the page's meta tags are: | name | content | | robots | noindex,nofollow | | keywords | momoney,moproblems | Then the rendered content should be: """ Page Under Test """ Scenario: body Given the page's body is "{% body %}" And the page's body is "
Page body
" Then the rendered content should be: """
Page body
""" Scenario: body with nested liquid tag Given the page's body is "{% body %}" And the page's body is "
Page body
{% meta_tags %}" And the page's meta tags are: | name | content | | robots | noindex,nofollow | | keywords | momoney,moproblems | Then the rendered content should be: """
Page body
""" Scenario: img_tag Given the page's body is "{% img_tag panda %}" Then the rendered content should be: """ Baz! """ Scenario: asset_url and asset_description Given the page's body is: """ Disclosures """ Then the rendered content should be: """ Disclosures """ Scenario: Referencing a template Given the page's body is: """
{% template bar %}
""" And the template "bar" with body "some stuff" And the template "has" been published Then the rendered content should be: """
some stuff
""" Scenario: Referencing file backed partials Given the page's body is: """
{% template partials_foobazz %}
""" And the template is a filed backed partial Then the rendered content should be: """
some stuff
""" Scenario: Referencing a template with variables Given the page's body is: """
{% template foobar body: "seven" footer: "the end" %}
""" And the template "foobar" with the body: """ {{ body | default: "eight" }} """ And the template "has" been published Then the rendered content should be: """
seven
""" Scenario: Referencing a template with variable defaults Given the page's body is: """
{% template bar %}
""" And the template "bar" with the body: """ {{ body | default: "eight" }} """ And the template "has" been published Then the rendered content should be: """
eight
""" Scenario: Referencing a template that hasn't been published Given the page's body is: """
{% template fubu %}
""" And the template "fubu" with the body: """ {{ body | default: "eight" }} """ And the template "hasn't" been published Then the rendered content should be: """
""" Scenario: Referencing a template that doesn't exist Given the page's body is: """
{% template fubu %}
""" Then the rendered content should be: """
""" Scenario: App asset tags Given the page's body is: """ {% stylesheet_link_tag application %} {% javascript_include_tag application %} {% image_tag foo.jpg %} {% img_tag foo.jpg %} {% image_tag panda %} """ Then the rendered body should be the correct assets