Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Root nesting has no test. #33

Merged
merged 1 commit into from

2 participants

@allanca

Added.

@tj
Owner
tj commented

awesome thanks man

@tj tj merged commit 94b1b98 into expressjs:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 6, 2011
  1. @allanca

    Add a test for root nesting

    allanca authored
This page is out of date. Refresh to see the latest.
Showing with 24 additions and 0 deletions.
  1. +24 −0 test/resource.test.js
View
24 test/resource.test.js
@@ -200,6 +200,30 @@ module.exports = {
{ body: 'show thread 50 of forum 1' });
},
+ 'test root nesting': function(){
+ var app = express.createServer();
+
+ var forum = app.resource(require('./fixtures/forum'));
+ var thread = app.resource('threads', require('./fixtures/thread'));
+ forum.map(thread);
+
+ assert.response(app,
+ { url: '/' },
+ { body: 'forum index' });
+
+ assert.response(app,
+ { url: '/12' },
+ { body: 'show forum 12' });
+
+ assert.response(app,
+ { url: '/12/threads' },
+ { body: 'thread index of forum 12' });
+
+ assert.response(app,
+ { url: '/1/threads/50' },
+ { body: 'show thread 50 of forum 1' });
+ },
+
'test shallow auto-loading': function(){
var app = express.createServer();
var Forum = require('./fixtures/forum').Forum;
Something went wrong with that request. Please try again.