app.head.js
This file
Path
test/app.head.js
43 lines · 814 bytes · JavaScript
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 1021c86 point at it.
update connect depTJ Holowaychukbefore adoption1021c86
lines 1–43why, one step back12var express = require('../')3 , request = require('./support/http')4 , assert = require('assert');56describe('HEAD', function(){7 it('should default to GET', function(done){8 var app = express();910 app.get('/tobi', function(req, res){11 // send() detects HEAD12 res.send('tobi');13 });1415 request(app)16 .head('/tobi')17 .expect(200, done);18 })19})2021describe('app.head()', function(){22 it('should override', function(done){23 var app = express()24 , called;2526 app.head('/tobi', function(req, res){27 called = true;28 res.end('');29 });3031 app.get('/tobi', function(req, res){32 assert(0, 'should not call GET');33 res.send('tobi');34 });3536 request(app)37 .head('/tobi')38 .expect(200, function(){39 assert(called);40 done();41 });42 })43})