Skip to content

Commit

Permalink
add additional attribute test
Browse files Browse the repository at this point in the history
  • Loading branch information
emaphp committed Mar 22, 2016
1 parent 6d27ddf commit b50331c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/loaderTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,18 @@ describe('loader', function () {
});
});

it('should modify dynamic attributes', function (done) {
it('should ignore root option if parseDynamicRoutes is not specified', function (done) {
testTemplate(loader, 'dynamic-attribute-with-root.html', {
query: {
root: '/bar'
}
}, function (output) {
assert.equal(removeFirstline(output), loadOutput('dynamic-attribute-with-root.txt'));
done();
});
});

it('should modify dynamic routes', function (done) {
testTemplate(loader, 'dynamic-attribute-with-parseDynamicRoutes.html', {
query: {
root: '/bar',
Expand Down
11 changes: 11 additions & 0 deletions test/templates/output/dynamic-attribute-with-root.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = (Handlebars['default'] || Handlebars).template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
var helper, alias1=helpers.helperMissing, alias2="function", alias3=this.escapeExpression;

return "<img src=\"images/"
+ alias3(((helper = (helper = helpers.imgFile || (depth0 != null ? depth0.imgFile : depth0)) != null ? helper : alias1),(typeof helper === alias2 ? helper.call(depth0,{"name":"imgFile","hash":{},"data":data}) : helper)))
+ "\" alt=\""
+ alias3(((helper = (helper = helpers.imgDescription || (depth0 != null ? depth0.imgDescription : depth0)) != null ? helper : alias1),(typeof helper === alias2 ? helper.call(depth0,{"name":"imgDescription","hash":{},"data":data}) : helper)))
+ "\">\n<img src=\"/images/"
+ alias3(((helper = (helper = helpers.imgFile || (depth0 != null ? depth0.imgFile : depth0)) != null ? helper : alias1),(typeof helper === alias2 ? helper.call(depth0,{"name":"imgFile","hash":{},"data":data}) : helper)))
+ "\">";
},"useData":true});

0 comments on commit b50331c

Please sign in to comment.