Skip to content
Myr

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 file

Take it

View is now a plugin [#87]visionmediabefore adoption8e408e3

lines 1–13why, one step back
1
2describe '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 end

Started view specsvisionmediabefore adoption00a8c64

lines 14–41why, one step back
14
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 end

View is now a plugin [#87]visionmediabefore adoption8e408e3

lines 42–43why, one step back
42 end
43end