Permalink
Browse files

Added catchall test

  • Loading branch information...
1 parent dc24694 commit 89703fd4309a3d7e3d8af5deb50c3dbc1da33d6a @tj tj committed Nov 12, 2010
Showing with 8 additions and 0 deletions.
  1. +8 −0 test/express.test.js
View
@@ -46,6 +46,10 @@ module.exports = {
server.post('/staff/:id', function(req, res){
res.send('POST Staff ' + req.staff.id);
});
+
+ server.all('*', function(req, res){
+ res.send('requested ' + req.url);
+ });
assert.response(server,
{ url: '/' },
@@ -70,6 +74,10 @@ module.exports = {
assert.response(server,
{ url: '/staff/12', method: 'POST' },
{ body: 'POST Staff 12' });
+
+ assert.response(server,
+ { url: '/foo/bar/baz', method: 'DELETE' },
+ { body: 'requested /foo/bar/baz' });
},
'test constructor middleware': function(assert, beforeExit){

0 comments on commit 89703fd

Please sign in to comment.