Skip to content
Myr

Merge branch 'partials'

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

authored by visionmedia · committed by visionmedia · parents d61c248, 5d10ee4 · Browse files · 7 files+85 added−7 removed
This commit

State

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

Diff stats

7 files+85 added−7 removed

  • tests:+43 added−0 removed
  • other:+42 added−7 removed

7 files+85 added−7 removed

added:examples/chat/views/partials/message.haml.html+1 added
modified:examples/chat/views/chat.haml.html+1 added-2 removed
modified:lib/express/plugins/view.js+40 added-5 removed
added:spec/fixtures/partials/item.haml.html+1 added
added:spec/fixtures/partials/video.haml.html+1 added
added:spec/fixtures/list.haml.html+3 added
modified:spec/spec.plugins.view.js+38 added
10 unmodified lines
11 set('views').should.eql 'spec/views'12 end13 end14 15 describe '#partial()'16 before_each17 set('views', 'spec/fixtures')18 end19 20 describe 'given a valid view name'21 it 'should render a partial'22 get('/', function(){23 this.render('list.haml.html', { locals: { items: ['foo', 'bar'] }})24 })25 get('/').body.should.include '<ul>'26 get('/').body.should.include '<li>foo'27 get('/').body.should.include '<li>bar'28 end29 30 it 'should render collections'31 get('/', function(){32 return this.partial('item.haml.html', {33 collection: ['foo', 'bar']34 })35 })36 get('/').body.should.include '<li>foo'37 get('/').body.should.include '<li>bar'38 end39 40 it 'should render collections with a given object name'41 get('/', function(){42 return this.partial('video.haml.html', {43 collection: ['im a movie', 'im another movie'],44 as: 'vid'45 })46 })47 get('/').body.should.include '<li>im a movie'48 get('/').body.should.include '<li>im another movie'49 end50 end51 end52 53 describe '#render()'54 before_each55 set('views', 'spec/fixtures')56 end
134 unmodified lines