File tree Expand file tree Collapse file tree
spec/middlewares/request_validation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -238,14 +238,21 @@ def fixture_path(name)
238238 header Rack ::CONTENT_TYPE , 'foo/bar'
239239 post path , JSON . generate ( { say : 'no ' } )
240240
241- expect ( last_response . status ) . to be ( 400 ) , last_response . body
241+ expect ( last_response . status ) . to be ( 400 )
242+ end
243+
244+ it 'returns 200 if content-type is unknown and request body is valid' do
245+ header Rack ::CONTENT_TYPE , 'foo/bar'
246+ post path , JSON . generate ( { say : 'yes' } )
247+
248+ expect ( last_response . status ) . to be ( 200 )
242249 end
243250
244251 it 'returns 400 if request body is invalid' do
245252 header Rack ::CONTENT_TYPE , 'application/json'
246253 post path , JSON . generate ( { say : 'no ' } )
247254
248- expect ( last_response . status ) . to be ( 400 ) , last_response . body
255+ expect ( last_response . status ) . to be ( 400 )
249256 end
250257 end
251258
You can’t perform that action at this time.
0 commit comments