Convert health check endpoint controller spec to request spec (#31565)
This commit is contained in:
		@@ -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
 | 
			
		||||
							
								
								
									
										16
									
								
								spec/requests/health_spec.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								spec/requests/health_spec.rb
									
									
									
									
									
										Normal file
									
								
							@@ -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
 | 
			
		||||
		Reference in New Issue
	
	Block a user