Skip to content
Myr

all tests pass now

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by csausdev · committed by TJ Holowaychuk · parent f4d7a5e · Browse files · 1 file+7 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−4 removed

  • tests:+7 added−4 removed

1 file+7 added−4 removed

modified:spec/spec.core.js+7 added-4 removed
186 unmodified lines
187 end188 189 describe 'BodyDecoder'190 it 'should parse urlencoded bodies'191 request = mockRequest({ 191 request = mockRequest({192 method: 'POST',193 headers : [['Content-Type', 'application/x-www-form-urlencoded']],194 body : 'user[name]=foo%20bar&status=1'195 })196 post('admin', function(){ param('user').name + ' ' + param('status') })197 post('admin', { request : request }).body.should.eql 'foo bar 1'198 end199200 it 'should parse JSON bodies'200 request = mockRequest({ 201 request = mockRequest({202 method: 'POST',203 headers : [['Content-Type', 'application/json']],204 body : '{ foo : "bar" }'205 })206 post('foo', function(){ param('foo') })
9 unmodified lines
216 end217 218 describe 'MethodOverride'219 it 'should override request method when _method param is present'218 request = mockRequest({ 220 request = mockRequest({221 method: 'POST',222 headers : [['Content-Type', 'application/x-www-form-urlencoded']],223 body : '_method=delete'224 })225 del('foo', function(){ 'Deleted' })223 post('foo', { request : { body : '_method=delete' }}).body.should.eql 'Deleted'226 post('foo', { request : request}).body.should.eql 'Deleted'227 end228 end229 230 describe 'DefaultContentType'
12 unmodified lines