Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test case for #696 #697

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
expect(child.render()).to.be('Foo*Bar*BazFizzle');
});

it('should respect if statement then extending block', function() {
var env = new Environment(new Loader(templatesPath));

var child = env.getTemplate('extends-blocks.j2');
expect(child.render()).to.be('Foocase 1BazFizzle');
});

it('should handle correctly relative paths', function() {
var env = new Environment(new Loader(templatesPath));

Expand Down
7 changes: 7 additions & 0 deletions tests/templates/extends-blocks.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends "base.j2" %}

{% if true %}
{% block block1 %}case 1{% endblock %}
{% else %}
{% block block1 %}case 2{% endblock %}}
{% endif %}