Skip to content
Myr

Merge branch 'partial-lookup'

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

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parents ff5c958, f25c14d · Browse files · 5 files+28 added−10 removed
This commit

State

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

Diff stats

5 files+28 added−10 removed

  • tests:+13 added−7 removed
  • other:+15 added−3 removed

5 files+28 added−10 removed

modified:examples/jade/views/user/list.jade+1 added-1 removed
1- if (users.length)2 h1 Users3 #users!= partial('user/user', users)3 #users!= partial('user', users)
modified:lib/express/view/partial.js+13 added-1 removed
modified:lib/express/view.js+1 added-1 removed
105 unmodified lines
106 } else {107 options.scope = options.object;108 }109 }110 return self.render(view, options);110 return self.render(view, options, null, parent);111 }112113 // Collection support114 var collection = options.collection;
145 unmodified lines
added:test/fixtures/forum/_thread.jade+1 added
1h1 Forum Thread
modified:test/view.test.js+12 added-7 removed
101 unmodified lines
102 resolve('forum thread post.ejs').should.equal('forumThreadPost');103 },104 105 'test Partial#path for partials': function(){106 var fixtures = __dirname + '/fixtures';107 106 var view = new Partial('user.ejs', { root: '/www' });107 view.path.should.equal('/www/_user.ejs');108 var view = new Partial('user.jade', { root: fixtures });109 view.path.should.equal(fixtures + '/_user.jade');110109 var view = new Partial('user', { parentView: view, root: '/www' });110 view.path.should.equal('/www/_user.ejs');111 var view = new Partial('user', { parentView: view, root: fixtures });112 view.path.should.equal(fixtures + '/_user.jade');113 114 var view = new Partial('forum/thread', { parentView: view });113 view.path.should.equal('/www/forum/_thread.ejs');115 view.path.should.equal(fixtures + '/forum/_thread.jade');116115 var view = new Partial('forum/thread.jade', { root: '/www' });116 view.path.should.equal('/www/forum/_thread.jade');117 var view = new Partial('forum/thread.jade', { root: fixtures });118 view.path.should.equal(fixtures + '/forum/_thread.jade');119120 var view = new Partial('thread', { parentView: view });121 view.path.should.equal(fixtures + '/forum/_thread.jade');122 },123124 'test #render()': function(){125 var app = create();
645 unmodified lines