From b50331c7fca4334842c14a8e0bb637416f319331 Mon Sep 17 00:00:00 2001 From: emaphp Date: Tue, 22 Mar 2016 16:55:08 -0300 Subject: [PATCH] add additional attribute test --- test/loaderTest.js | 13 ++++++++++++- .../output/dynamic-attribute-with-root.txt | 11 +++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 test/templates/output/dynamic-attribute-with-root.txt diff --git a/test/loaderTest.js b/test/loaderTest.js index 69c7dc5..30f5ab9 100644 --- a/test/loaderTest.js +++ b/test/loaderTest.js @@ -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', diff --git a/test/templates/output/dynamic-attribute-with-root.txt b/test/templates/output/dynamic-attribute-with-root.txt new file mode 100644 index 0000000..34c0214 --- /dev/null +++ b/test/templates/output/dynamic-attribute-with-root.txt @@ -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 "\""\n"; +},"useData":true}); \ No newline at end of file