File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -175,18 +175,32 @@ def app; subject end
175175 subject . post '/request_body' do
176176 params [ :user ]
177177 end
178+
179+ subject . put '/request_body' do
180+ params [ :user ]
181+ end
178182 end
179183
180184 it 'should convert JSON bodies to params' do
181185 post '/request_body' , MultiJson . encode ( user : 'Bobby T.' ) , { 'CONTENT_TYPE' => 'application/json' }
182186 last_response . body . should == 'Bobby T.'
183187 end
184188
189+ it 'should convert JSON bodies to params' do
190+ put '/request_body' , MultiJson . encode ( user : 'Bobby T.' ) , { 'CONTENT_TYPE' => 'application/json' }
191+ last_response . body . should == 'Bobby T.'
192+ end
193+
185194 it 'should convert XML bodies to params' do
186195 post '/request_body' , '<user>Bobby T.</user>' , { 'CONTENT_TYPE' => 'application/xml' }
187196 last_response . body . should == 'Bobby T.'
188197 end
189198
199+ it 'should convert XML bodies to params' do
200+ put '/request_body' , '<user>Bobby T.</user>' , { 'CONTENT_TYPE' => 'application/xml' }
201+ last_response . body . should == 'Bobby T.'
202+ end
203+
190204 it 'does not include parameters not defined by the body' do
191205 subject . post '/omitted_params' do
192206 body_params [ :version ] . should == nil
You can’t perform that action at this time.
0 commit comments