mirror of
https://github.com/zebrajr/express.git
synced 2025-12-06 12:19:51 +01:00
27 lines
766 B
JavaScript
27 lines
766 B
JavaScript
|
|
var express = require('../')
|
|
|
|
describe('app', function(){
|
|
describe('.locals(obj)', function(){
|
|
it('should merge locals', function(){
|
|
var app = express();
|
|
Object.keys(app.locals).should.eql(['settings']);
|
|
app.locals.user = 'tobi';
|
|
app.locals.age = 2;
|
|
Object.keys(app.locals).should.eql(['settings', 'user', 'age']);
|
|
app.locals.user.should.equal('tobi');
|
|
app.locals.age.should.equal(2);
|
|
})
|
|
})
|
|
|
|
describe('.locals.settings', function(){
|
|
it('should expose app settings', function(){
|
|
var app = express();
|
|
app.set('title', 'House of Manny');
|
|
var obj = app.locals.settings;
|
|
obj.should.have.property('env', 'test');
|
|
obj.should.have.property('title', 'House of Manny');
|
|
})
|
|
})
|
|
})
|