Skip to content
Myr

Renaming `Globals` to `helpers` (I'm sold)

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

authored by Guillermo Rauch · committed by Guillermo Rauch · parent 216cb1e · Browse files · 2 files+6 added−6 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+6 added−6 removed

  • tests:+3 added−3 removed
  • other:+3 added−3 removed

2 files+6 added−6 removed

modified:lib/express/plugins/view.js+3 added-3 removed
modified:spec/spec.plugins.view.js+3 added-3 removed
12ejs = require('ejs')3Globals = require('express/plugins/view').Globals3helpers = require('express/plugins/view').helpers45describe 'Express'6 before_each7 reset()
207 unmodified lines
215 end216 217 describe 'when a global is set'218 it 'should include the helper and translate the text in the view'219 Globals._ = function(text){219 helpers._ = function(text){220 if (text == 'Hello world') return 'Hola mundo'221 }222 get('/', function(){223 this.render('helpers.html.haml', { layout: false })224 })225 get('/').body.should.include 'Hola mundo'226 end227 it 'should include the helper and translate the text in the layout'228 Globals._ = function(text){228 helpers._ = function(text){229 if (text == 'Testing') return 'Probando'230 }231 get('/', function(){232 this.render('helpers-layout.html.haml', { layout: 'layout-helper' })
62 unmodified lines