Feature: Polymorphic tags
Scenario: Using a polymorphic tag
Given a file named "example_taglib.dryml" with:
"""
<%= this.title %>
<%= this.name %>
"""
And a file named "example.dryml" with:
"""
"""
When I include the taglib "example_taglib"
And the current context is a blog post
And I render "example.dryml"
Then the output DOM should be:
"""
"""
Scenario: Using a polymorphic tag for a subclass
Given a file named "example_taglib.dryml" with:
"""
<%= this.title %>
<%= this.name %>
"""
And a file named "example.dryml" with:
"""
"""
When I include the taglib "example_taglib"
And the current context is a special blog post
And I render "example.dryml"
Then the output DOM should be:
"""
"""
Scenario: Using a polymorphic tag for a subclass with a customized tag (fails)
issue 779 / https://github.com/tablatom/hobo/commit/aceb7afc384287b19e59ebb94020a2c509143c76
Given a file named "example_taglib.dryml" with:
"""
<%= this.title %>
<%= this.name %>
"""
And a file named "example.dryml" with:
"""
"""
When I include the taglib "example_taglib"
And the current context is a special blog post
And I render "example.dryml"
Then the output DOM should be:
"""
"""
Scenario: using call-tag to call a polymorphic tag
Given a file named "example_taglib.dryml" with:
"""
<%= this.title %>
<%= this.name %>
"""
And a file named "example.dryml" with:
"""
"""
When I include the taglib "example_taglib"
And the current context is a blog post
And I render "example.dryml"
Then the output DOM should be:
"""
"""
Scenario: using call-tag to call a polymorphic tag with an explicit type (fails)
Given a file named "example_taglib.dryml" with:
"""
<%= this.title %>
<%= this.name %>
"""
And a file named "example.dryml" with:
"""
"""
When I include the taglib "example_taglib"
And the current context is a special blog post
And I render "example.dryml"
Then the output DOM should be:
"""
"""