Skip to content
Myr

spec.plugins.method-override.js

This file

Path

spec/spec.plugins.method-override.js

27 lines · 748 bytes · JavaScript

Last changed by

Added MethodOverridevisionmediabefore adoption938dc06

History of this file

Take it

Added specs for MethodOverridevisionmediabefore adoptiondb4dcf8

lines 1–14why, one step back
1
2describe 'Express'3 before_each4 reset()5 use(require('express/plugins/method-override').MethodOverride)6 end7 8 describe 'MethodOverride'9 describe 'on'10 describe 'request'11 it 'should consider __method__ as the HTTP method'12 put('/user', function(){13 return 'updated user'14 })

Added MethodOverridevisionmediabefore adoption938dc06

lines 15–22why, one step back
15 post('/user', { uri: { params: { __method__: 'put' }}}).body.should.eql 'updated user'
16 end17 18 it 'should force __method__ to lowercase to conform to internal uses'19 put('/user', function(){20 return 'updated user'21 })22 post('/user', { uri: { params: { __method__: 'PUT' }}}).body.should.eql 'updated user'

Added specs for MethodOverridevisionmediabefore adoptiondb4dcf8

lines 23–27why, one step back
23 end
24 end25 end26 end27end