File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929
3030 def with_http_status ( status )
3131 if status . is_a? Symbol
32- @status = Rack ::Utils ::SYMBOL_TO_STATUS_CODE [ status ]
32+ @status = Rack ::Utils ::SYMBOL_TO_STATUS_CODE . fetch ( status ) do
33+ raise ArgumentError , "Unknown status #{ status . inspect } "
34+ end
3335 else
3436 @status = status
3537 end
Original file line number Diff line number Diff line change 9090 it { is_expected . to match_openapi_doc ( doc ) . with_http_status ( :bad_request ) }
9191 end
9292
93+ context 'when using unsupported status' do
94+ it {
95+ expect {
96+ expect ( subject ) . to match_openapi_doc ( doc ) . with_http_status ( :does_not_exist_in_rack )
97+ } . to raise_error ( ArgumentError , 'Unknown status :does_not_exist_in_rack' )
98+ }
99+ end
100+
93101 context 'when using dynamic paths' do
94102 let ( :path ) { '/messages/ef278ab2' }
95103 let ( :response_json ) do
You can’t perform that action at this time.
0 commit comments