Skip to content

Commit

Permalink
Add test to check for multiple DELETEs in app.all
Browse files Browse the repository at this point in the history
  • Loading branch information
mscdex committed Feb 5, 2012
1 parent 77645bc commit 4363b20
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/router.test.js
Expand Up @@ -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.