I have a simple controller action which is used for checking that the app is running.
def check(id=1)
Car.find(id)
render nothing: true, status: 200
rescue
render nothing: true, status: 500
end
How do I test the exception. Below is the test for the happy path.
RSpec.describe HealthController do
describe "GET #check" do
it "returns 200" do
expect(response).to have_http_status(200)
end
end