spec.plugins.body-decoder.js
This file
Path
spec/spec.plugins.body-decoder.js
26 lines · 883 bytes · JavaScript
Last changed by
Added BodyDecoder plugin, required by corevisionmediabefore adoption251c027
History of this fileTake it
Added BodyDecoder plugin, required by corevisionmediabefore adoption251c027
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