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
View is now a plugin [#87]visionmediabefore adoption8e408e3
lines 1–13why, one step back12describe 'Express'3 before_each4 reset()5 end6 7 describe 'View'8 describe 'set("views")'9 it 'should default to <root>/views'10 set('root', 'spec')11 set('views').should.eql 'spec/views'12 end13 endStarted view specsvisionmediabefore adoption00a8c64
lines 14–41why, one step back14 15 describe '#render()'16 before_each17 set('views', 'spec/fixtures')18 end19 20 describe 'given a valid view name'21 describe 'and layout of the same type exists'22 it 'should render the view'23 get('/', function(){24 this.render('hello.haml.html')25 })26 get('/').body.should.include '<html><body>'27 get('/').body.should.include '<h2>Hello'28 end29 end30 31 describe 'and layout of the same type does not exist'32 it 'should throw an error'33 get('/', function(){34 this.render('hello.haml.html', { layout: 'front' })35 })36 -{ get('/') }.should.throw_error 'No such file or directory'37 end38 end39 end40 41 endView is now a plugin [#87]visionmediabefore adoption8e408e3
lines 42–43why, one step back42 end43end