spec/sinatra/errorcodes_spec.rb in sinatra-errorcodes-0.1.1 vs spec/sinatra/errorcodes_spec.rb in sinatra-errorcodes-0.1.2
- old
+ new
@@ -24,6 +24,18 @@
it 'returns status 400' do
get '/badrequest'
expect(last_response.status).to be 400
expect(last_response.body).to eq 'Bad Request'
end
+
+ it 'returns status 500 with a custom error message' do
+ get '/custom'
+ expect(last_response.status).to be 500
+ expect(last_response.body).to eq 'Custom error message'
+ end
+
+ it 'returns status 500 without a message of HTTPError::InternalServerError' do
+ get '/general_error'
+ expect(last_response.status).to be 500
+ expect(last_response.body).not_to eq 'Internal Server Error'
+ end
end