From 641ae6a2cf7eac47599620bc9cb24095829418e0 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 26 Aug 2024 08:17:35 -0400 Subject: [PATCH] Convert health check endpoint controller spec to request spec (#31565) --- spec/controllers/health_controller_spec.rb | 14 -------------- spec/requests/health_spec.rb | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 14 deletions(-) delete mode 100644 spec/controllers/health_controller_spec.rb create mode 100644 spec/requests/health_spec.rb diff --git a/spec/controllers/health_controller_spec.rb b/spec/controllers/health_controller_spec.rb deleted file mode 100644 index 282b66419..000000000 --- a/spec/controllers/health_controller_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe HealthController do - render_views - - describe 'GET #show' do - it 'returns http success' do - get :show - expect(response).to have_http_status(200) - end - end -end diff --git a/spec/requests/health_spec.rb b/spec/requests/health_spec.rb new file mode 100644 index 000000000..03317f972 --- /dev/null +++ b/spec/requests/health_spec.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe 'Health check endpoint' do + describe 'GET /health' do + it 'returns http success when server is functioning' do + get '/health' + + expect(response) + .to have_http_status(200) + expect(response.body) + .to include('OK') + end + end +end