From 8c08fa162f784a7d0341e54a6b52005c62c4e460 Mon Sep 17 00:00:00 2001 From: Chad Kouse Date: Fri, 11 Apr 2014 01:21:23 -0400 Subject: [PATCH 1/5] allow defaultExtension --- lib/schema.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/schema.js b/lib/schema.js index 2f1c91843..f31ee7ca5 100755 --- a/lib/schema.js +++ b/lib/schema.js @@ -107,7 +107,8 @@ internals.server = { }), tls: Joi.object().allow(null), views: internals.viewSchema({ - engines: Joi.object().required() + engines: Joi.object().required(), + defaultExtension: Joi.string() }), maxSockets: Joi.number().positive().allow(false) }; From 8729a3f0c166827bbe597562f89908927d420daf Mon Sep 17 00:00:00 2001 From: Chad Kouse Date: Fri, 11 Apr 2014 01:25:34 -0400 Subject: [PATCH 2/5] move to view schema --- lib/schema.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/schema.js b/lib/schema.js index f31ee7ca5..be0bb126d 100755 --- a/lib/schema.js +++ b/lib/schema.js @@ -40,7 +40,8 @@ internals.viewSchema = function (base) { partialsPath: Joi.string(), helpersPath: Joi.string(), contentType: Joi.string(), - compileMode: Joi.string().valid('sync', 'async') + compileMode: Joi.string().valid('sync', 'async'), + defaultExtension: Joi.string() }; return Utils.merge(schema, base); @@ -107,8 +108,7 @@ internals.server = { }), tls: Joi.object().allow(null), views: internals.viewSchema({ - engines: Joi.object().required(), - defaultExtension: Joi.string() + engines: Joi.object().required() }), maxSockets: Joi.number().positive().allow(false) }; From 51ba935d531eb834e2f793c6b43f159a5f62479f Mon Sep 17 00:00:00 2001 From: Chad Kouse Date: Fri, 11 Apr 2014 02:04:35 -0400 Subject: [PATCH 3/5] adding test --- test/schema.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/schema.js b/test/schema.js index ddbe08993..e6e59337b 100755 --- a/test/schema.js +++ b/test/schema.js @@ -174,5 +174,16 @@ describe('Schema', function () { expect(Schema.view(config)).to.exist; done(); }); + + it('suceeds with minimal config', function(done) { + var config = { + module: "baz", + path: "foo", + defaultExtension: "bar" + }; + console.log("CK", Schema.view(config)); + expect(Schema.view(config)).to.not.exist; + done(); + }); }); }); \ No newline at end of file From 9019752bc50b3271a51121f9de153a3280bd683f Mon Sep 17 00:00:00 2001 From: Chad Kouse Date: Fri, 11 Apr 2014 02:05:24 -0400 Subject: [PATCH 4/5] remove debug code --- test/schema.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/schema.js b/test/schema.js index e6e59337b..90d435ec3 100755 --- a/test/schema.js +++ b/test/schema.js @@ -181,7 +181,6 @@ describe('Schema', function () { path: "foo", defaultExtension: "bar" }; - console.log("CK", Schema.view(config)); expect(Schema.view(config)).to.not.exist; done(); }); From ee213c6105a2f6d1a70d9c11a86768dbd1493b28 Mon Sep 17 00:00:00 2001 From: Chad Kouse Date: Sun, 13 Apr 2014 22:20:23 -0400 Subject: [PATCH 5/5] fix spelling typo --- test/schema.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/schema.js b/test/schema.js index 90d435ec3..de7f9b452 100755 --- a/test/schema.js +++ b/test/schema.js @@ -175,7 +175,7 @@ describe('Schema', function () { done(); }); - it('suceeds with minimal config', function(done) { + it('succeeds with minimal config', function(done) { var config = { module: "baz", path: "foo",