Skip to content
Myr

Added spec / refactored layout of different engine support

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent 46bee05 · Browse files · 4 files+17 added−13 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+17 added−13 removed

  • tests:+11 added−9 removed
  • other:+6 added−4 removed

4 files+17 added−13 removed

modified:lib/express/plugins/view.js+6 added-4 removed
added:spec/fixtures/layout-user.html.haml+2 added
1%title= "Viewing " + name2%body!= body
deleted:spec/fixtures/layout.user.html.haml-2 removed
1%title= "Viewing " + name2%body!= body
modified:spec/spec.plugins.view.js+9 added-7 removed
147 unmodified lines
148 get('/').body.should.include '<h2>Hello'149 end150 end151 152 describe 'given a full layout name'152 describe 'given a layout name with a different engine'153 get('/', function(){154 this.render('hello.html.haml', { layout: 'layout.html.ejs' })155 })156 get('/').body.should.include '<h2>Hello'157 get('/').body.should.include '<p>'153 it 'should render a layout of a different engine'154 get('/', function(){155 this.render('hello.html.haml', { layout: 'layout.html.ejs' })156 })157 get('/').body.should.include '<h2>Hello'158 get('/').body.should.include '<p>'159 end160 end161 162 describe 'when layout: false'163 it 'should render the view only'
30 unmodified lines
194 195 it 'should have direct access to locals within the layout'196 get('/user', function(){197 this.render('user.html.haml', {196 layout: 'layout.user',198 layout: 'layout-user',199 locals: {200 name: 'tj',201 email: 'tj@vision-media.ca'202 }
26 unmodified lines