Skip to content

Commit

Permalink
Add tests for relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
SamyPesse committed Feb 10, 2015
1 parent 9946ee8 commit 40d4ce7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/api.js
Expand Up @@ -22,5 +22,15 @@
var child = env.getTemplate('base-inherit.html');
expect(child.render()).to.be('Foo*Bar*BazFizzle');
});

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

var child1 = env.getTemplate('relative/test1.html');
var child2 = env.getTemplate('relative/test2.html');

expect(child1.render()).to.be('FooTest1BazFizzle');
expect(child2.render()).to.be('FooTest2BazFizzle');
});
});
})();
3 changes: 3 additions & 0 deletions tests/templates/relative/test1.html
@@ -0,0 +1,3 @@
{% extends "../base.html" %}

{% block block1 %}Test1{% endblock %}
3 changes: 3 additions & 0 deletions tests/templates/relative/test2.html
@@ -0,0 +1,3 @@
{% extends "./test1.html" %}

{% block block1 %}Test2{% endblock %}

0 comments on commit 40d4ce7

Please sign in to comment.