Permalink
Browse files

Add test to check for multiple DELETEs in app.all

  • Loading branch information...
1 parent 77645bc commit 4363b20186af5191caa8ce017e063d018823c1f8 @mscdex mscdex committed Feb 5, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 test/router.test.js
View
@@ -821,5 +821,25 @@ module.exports = {
assert.response(app,
{ url: '/1/2/3' },
{ body: '["1","2","3"]' });
+ },
+
+ 'test app.all for multiple deletes': function(beforeExit){
+ var app = express.createServer();
+
+ var deletes = 0;
+
+ app.all('*', function(req, res, next){
+ if (req.method === 'DELETE')
+ deletes++;
+ next();
+ });
+
+ assert.response(app,
+ { url: '/', method: 'DELETE' },
+ { status: 404 });
+
+ beforeExit(function(){
+ deletes.should.eql(1);
+ });
}
};

0 comments on commit 4363b20

Please sign in to comment.