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 fileTake it
123456789101112131415161718192021222324252627
describe 'Express' before_each reset() use(require('express/plugins/method-override').MethodOverride) end describe 'MethodOverride' describe 'on' describe 'request' it 'should consider __method__ as the HTTP method' put('/user', function(){ return 'updated user' }) post('/user', { uri: { params: { __method__: 'put' }}}).body.should.eql 'updated user' end it 'should force __method__ to lowercase to conform to internal uses' put('/user', function(){ return 'updated user' }) post('/user', { uri: { params: { __method__: 'PUT' }}}).body.should.eql 'updated user' end end end endend