Skip to content
Myr

params.js

This file

Path

test/acceptance/params.js

44 lines · 1.0 KiB · JavaScript

Last changed by

examples: make main app file names consistentDouglas Christopher Wilsonbefore adoptionb1d0c19

History of this file

Take it

The walk stopped after 200 commits: lines older than 269dc53 point at it.

examples: make main app file names consistentDouglas Christopher Wilsonbefore adoptionb1d0c19

line 1why, one step back
1var app = require('../../examples/params')

Invoke router.param() only when route matchesDouglas Christopher Wilsonbefore adoption269dc53

lines 2–44why, one step back
2var request = require('supertest')
34describe('params', function(){5 describe('GET /', function(){6 it('should respond with instructions', function(done){7 request(app)8 .get('/')9 .expect(/Visit/,done)10 })11 })1213 describe('GET /user/0', function(){14 it('should respond with a user', function(done){15 request(app)16 .get('/user/0')17 .expect(/user tj/,done)18 })19 })2021 describe('GET /user/9', function(){22 it('should fail to find user', function(done){23 request(app)24 .get('/user/9')25 .expect(/failed to find user/,done)26 })27 })2829 describe('GET /users/0-2', function(){30 it('should respond with three users', function(done){31 request(app)32 .get('/users/0-2')33 .expect(/users tj, tobi/,done)34 })35 })3637 describe('GET /users/foo-bar', function(){38 it('should fail integer parsing', function(done){39 request(app)40 .get('/users/foo-bar')41 .expect(/failed to parseInt foo/,done)42 })43 })44})