app.locals.js
This file
Path
test/app.locals.js
27 lines · 802 bytes · JavaScript
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 6bc7574 point at it.
docs: typo fixesDouglas Christopher Wilsonbefore adoption6bc7574
lines 1–27why, one step back12var express = require('../')3 , request = require('supertest');45describe('app', function(){6 describe('.locals(obj)', function(){7 it('should merge locals', function(){8 var app = express();9 Object.keys(app.locals).should.eql(['settings']);10 app.locals.user = 'tobi';11 app.locals.age = 2;12 Object.keys(app.locals).should.eql(['settings', 'user', 'age']);13 app.locals.user.should.equal('tobi');14 app.locals.age.should.equal(2);15 })16 })1718 describe('.locals.settings', function(){19 it('should expose app settings', function(){20 var app = express();21 app.set('title', 'House of Manny');22 var obj = app.locals.settings;23 obj.should.have.property('env', 'test');24 obj.should.have.property('title', 'House of Manny');25 })26 })27})