Skip to content
Myr

spec.plugins.content-length.js

This file

Path

spec/spec.plugins.content-length.js

28 lines · 731 bytes · JavaScript

Last changed by

Added ContentLength pluginvisionmediabefore adoptiondea4ac9

History of this file

Take it

Added ContentLength pluginvisionmediabefore adoptiondea4ac9

lines 1–28why, one step back
1
2describe 'Express'3 before_each4 reset()5 use(require('express/plugins/content-length').ContentLength)6 end7 8 describe 'ContentLength'9 describe 'on'10 describe 'response'11 it 'should set the content-length header'12 get('/style.css', function(){13 return 'body { background: #000; }'14 })15 get('/style.css').headers['content-length'].should.eql 2616 end17 18 it 'should not override when manually set'19 get('/style.css', function(){20 header('content-length', 10)21 return 'body { background: #000; }'22 })23 get('/style.css').headers['content-length'].should.eql 1024 end25 end26 end27 end28end