Skip to content
Myr

Better app.helper() test

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 · parent 20fae6e · Browse files · 2 files+5 added−5 removed
This commit

State

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

Diff stats

2 files+5 added−5 removed

  • tests:+5 added−5 removed

2 files+5 added−5 removed

modified:test/fixtures/dynamic-helpers.jade+1 added-1 removed
1p #{session.name} #{lastName} #{foo()}1p #{greetings(session, lastName)}
modified:test/view.test.js+4 added-4 removed
211 unmodified lines
212 var app = create();213214 app.helpers({ 215 lastName: 'holowaychuk',216 foo: function(){217 return 'bar'; 216 greetings: function(sess, lastName){217 return 'Hello ' + sess.name + ' ' + lastName; 218 }219 });220221 var ret = app.dynamicHelpers({
22 unmodified lines
244 });245 246 assert.response(app,247 { url: '/' },248 { body: '<p>tj holowaychuk bar</p>' });248 { body: '<p>Hello tj holowaychuk</p>' });249 assert.response(app,250 { url: '/precedence' },251 { body: '<p>tj foobar bar</p>' });251 { body: '<p>Hello tj foobar</p>' });252 },253 254 'test #partial()': function(assert){255 var app = create();
203 unmodified lines