spec.plugins.body-decoder.js
This file
Path
spec/spec.plugins.body-decoder.js
26 lines · 883 bytes · JavaScript
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 0554cbb point at it.
Splat for sendfile() in example appvisionmediabefore adoption0554cbb
lines 1–26why, one step back12describe 'Express'3 describe 'BodyDecoder'4 describe 'given "application/x-www-form-urlencoded"'5 it 'should parse body as urlencoded params'6 post('/login', function(){7 return this.param('name')8 })9 var response = post('/login', { body: 'name=tj', headers: { 'content-type': 'application/x-www-form-urlencoded' }})10 response.status.should.eql 20011 response.body.should.eql 'tj'12 end13 14 describe 'with charset'15 it 'should parse body as urlencoded params'16 post('/login', function(){17 return this.param('name')18 })19 var response = post('/login', { body: 'name=tj', headers: { 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8' }})20 response.status.should.eql 20021 response.body.should.eql 'tj'22 end23 end24 end25 end26end