Permalink
Browse files

tests for app.get() inheritance. Closes #904

  • Loading branch information...
1 parent 28f32b9 commit 15e7218bc465677b03b7773fc93c1060222a7141 @tj tj committed Nov 24, 2011
Showing with 22 additions and 0 deletions.
  1. +22 −0 test/config.js
View
@@ -21,6 +21,28 @@ describe('config', function(){
app.set('foo', 'bar');
app.get('foo').should.equal('bar');
})
+
+ describe('when mounted', function(){
+ it('should default to the parent app', function(){
+ var app = express()
+ , blog = express();
+
+ app.set('title', 'Express');
+ app.use(blog);
+ blog.get('title').should.equal('Express');
+ })
+
+ it('should given precedence to the child', function(){
+ var app = express()
+ , blog = express();
+
+ app.use(blog);
+ app.set('title', 'Express');
+ blog.set('title', 'Some Blog');
+
+ blog.get('title').should.equal('Some Blog');
+ })
+ })
})
describe('.enable()', function(){

0 comments on commit 15e7218

Please sign in to comment.