Skip to content
Myr

Added more route matching tests

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

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 3c002d0 · Browse files · 1 file+35 added−1 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+35 added−1 removed

  • tests:+35 added−1 removed

1 file+35 added−1 removed

modified:test/app.router.js+35 added-1 removed
12var express = require('../')3 , request = require('./support/http');3 , request = require('./support/http')4 , assert = require('assert');56describe('app.router', function(){7 describe('methods supported', function(){8 express.methods.forEach(function(method){
427 unmodified lines
436 .expect('foo as json', done);437 });438 })439 })440 441 describe('when next() is called', function(){442 it('should continue lookup', function(done){443 var app = express()444 , calls = [];445446 app.get('/foo/:bar?', function(req, res, next){447 calls.push('/foo/:bar?');448 next();449 });450451 app.get('/bar', function(req, res){452 assert(0);453 });454455 app.get('/foo', function(req, res, next){456 calls.push('/foo');457 next();458 });459 460 app.get('/foo', function(req, res, next){461 calls.push('/foo 2');462 res.end('done');463 });464465 request(app)466 .get('/foo')467 .expect('done', function(){468 calls.should.eql(['/foo/:bar?', '/foo', '/foo 2']);469 done();470 })471 })472 })473})