mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 05:50:43 -07:00
feature: support static filepath resolving by options.dynamicPartials,
fix #51
This commit is contained in:
@@ -88,4 +88,14 @@ describe('tags/include', function () {
|
||||
return expect(liquid.renderFile('personInfo.html', ctx)).to
|
||||
.eventually.equal('This is a person <p>Joe Shmoe<br/>City: Dallas</p>')
|
||||
})
|
||||
|
||||
it('should support static filename', function () {
|
||||
var staticLiquid = new Liquid({dynamicPartials: false, root: '/'})
|
||||
mock({
|
||||
'/with.html': 'X{% include color.html shape: "rect" %}Y',
|
||||
'/color.html': 'shape:{{shape}}'
|
||||
})
|
||||
return expect(staticLiquid.renderFile('with.html')).to
|
||||
.eventually.equal('Xshape:rectY')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -96,4 +96,13 @@ describe('tags/layout', function () {
|
||||
return expect(liquid.renderFile('/main.html')).to
|
||||
.eventually.equal('blackredA')
|
||||
})
|
||||
it('should support static filename', function () {
|
||||
mock({
|
||||
'/parent.html': '{{color}}{%block%}{%endblock%}',
|
||||
'/main.html': '{% layout parent.html color:"black"%}{%block%}A{%endblock%}'
|
||||
})
|
||||
var staticLiquid = Liquid({ root: '/', dynamicPartials: false })
|
||||
return expect(staticLiquid.renderFile('/main.html')).to
|
||||
.eventually.equal('blackA')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user