Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "vision", | ||
"description": "Templates rendering support for hapi.js", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"repository": "git://github.com/hapijs/vision", | ||
@@ -6,0 +6,0 @@ "main": "index", |
@@ -23,34 +23,4 @@ // Load modules | ||
describe('Vision', function () { | ||
describe('Manager', function () { | ||
it('should not fail if rendered template returns undefined', function (done) { | ||
var server = new Hapi.Server(); | ||
server.handler('viewTest', Vision.handler); | ||
server._views = new Vision.Manager({ | ||
engines: { | ||
html: { | ||
module: { | ||
compile: function (template, options) { | ||
return function (context, options) { | ||
return undefined; | ||
} | ||
} | ||
}, | ||
path: __dirname + '/templates/valid' | ||
} | ||
} | ||
}); | ||
server.route({ method: 'GET', path: '/', handler: { viewTest: { template: 'test.html' } } }); | ||
server.inject('/', function (res) { | ||
expect(res.statusCode).to.equal(200); | ||
done(); | ||
}); | ||
}); | ||
it('renders handlebars template', function (done) { | ||
@@ -237,4 +207,34 @@ | ||
describe('Layout', function (done) { | ||
it('should not fail if rendered template returns undefined', function (done) { | ||
var server = new Hapi.Server(); | ||
server.handler('viewTest', Vision.handler); | ||
server._views = new Vision.Manager({ | ||
engines: { | ||
html: { | ||
module: { | ||
compile: function (template, options) { | ||
return function (context, options) { | ||
return undefined; | ||
} | ||
} | ||
}, | ||
path: __dirname + '/templates/valid' | ||
} | ||
} | ||
}); | ||
server.route({ method: 'GET', path: '/', handler: { viewTest: { template: 'test.html' } } }); | ||
server.inject('/', function (res) { | ||
expect(res.statusCode).to.equal(200); | ||
done(); | ||
}); | ||
}); | ||
describe('with layout', function (done) { | ||
it('returns response', function (done) { | ||
@@ -448,3 +448,3 @@ | ||
describe('Multiple', function () { | ||
describe('with multiple engines', function () { | ||
@@ -451,0 +451,0 @@ it('renders handlebars template', function (done) { |
74810
61
1495
4