Skip to content
Myr

tests: add test for app.delete

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent 4179998 · Browse files · 1 file+8 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−7 removed

  • tests:+8 added−7 removed

1 file+8 added−7 removed

modified:test/app.router.js+8 added-7 removed
12var express = require('../')3 , request = require('./support/http')3 , request = require('supertest')4 , assert = require('assert')5 , methods = require('methods');67describe('app.router', function(){8 describe('methods supported', function(){9 methods.forEach(function(method){9 methods.concat('del').forEach(function(method){10 if (method === 'connect') return;1112 it('should include ' + method.toUpperCase(), function(done){11 if (method == 'delete') method = 'del';13 var app = express();14 var calls = [];1516 app[method]('/foo', function(req, res){
135 unmodified lines
152 it('should populate req.params with the captures', function(done){153 var app = express();154155 app.get(/^\/user\/([0-9]+)\/(view|edit)?$/, function(req, res){155 var id = req.params.shift()156 , op = req.params.shift();156 var id = req.params[0]157 , op = req.params[1];158 res.end(op + 'ing user ' + id);159 });160161 request(app)
166 unmodified lines
328 it('should work with several', function(done){329 var app = express();330331 app.get('/api/*.*', function(req, res){331 var resource = req.params.shift()332 , format = req.params.shift();332 var resource = req.params[0]333 , format = req.params[1];334 res.end(resource + ' as ' + format);335 });336337 request(app)
288 unmodified lines