Fix tests for health check endpoint [SCI-3522]

This commit is contained in:
Oleksii Kriuchykhin 2019-05-31 16:48:10 +02:00
parent 552f69b9b1
commit 2842ea381e

View file

@ -1,18 +1,6 @@
require 'rails_helper'
describe Api::ApiController, type: :controller do
describe 'GET #health' do
before do
get :health
end
it 'Returns HTTP success and with correct text' do
expect(response).to be_success
expect(response).to have_http_status(200)
expect(response.body).to match('RUNNING')
end
end
describe 'GET #status' do
before do
get :status
@ -40,6 +28,10 @@ describe Api::ApiController, type: :controller do
describe 'GET #health' do
before do
stub_request(:get, Rails.application.secrets.system_notifications_uri + '/api/system_notifications')
.with(query: hash_including('channels_slug': Rails.application.secrets.system_notifications_channel),
headers: { 'Accept': 'application/vnd.system-notifications.1+json' })
.to_return(status: 200, body: '', headers: {})
get :health
end