spec.plugins.view.js
This file
Path
spec/spec.plugins.view.js
43 lines · 1.0 KiB · JavaScript
Last changed by
Started view specsvisionmediabefore adoption00a8c64
History of this fileTake it
12345678910111213141516171819202122232425262728293031323334353637383940414243
describe 'Express' before_each reset() end describe 'View' describe 'set("views")' it 'should default to <root>/views' set('root', 'spec') set('views').should.eql 'spec/views' end end describe '#render()' before_each set('views', 'spec/fixtures') end describe 'given a valid view name' describe 'and layout of the same type exists' it 'should render the view' get('/', function(){ this.render('hello.haml.html') }) get('/').body.should.include '<html><body>' get('/').body.should.include '<h2>Hello' end end describe 'and layout of the same type does not exist' it 'should throw an error' get('/', function(){ this.render('hello.haml.html', { layout: 'front' }) }) -{ get('/') }.should.throw_error 'No such file or directory' end end end end endend