Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/controllers/health/health_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ class HealthController < AbstractHealthController
def health_checker
checkers = {
database: DatabaseHealthChecker,
account_reset: AccountResetHealthChecker,
}
MultiHealthChecker.new(**checkers)
end
Expand Down
29 changes: 0 additions & 29 deletions app/services/account_reset_health_checker.rb

This file was deleted.

9 changes: 0 additions & 9 deletions spec/controllers/health/health_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,27 @@
context 'when all checked resources are healthy' do
it 'returns a successful JSON response' do
allow(DatabaseHealthChecker).to receive(:simple_query).and_return('foo')
allow(AccountResetHealthChecker).to receive(:check).
and_return(HealthCheckSummary.new(healthy: true, result: 'foo'))

get :index
json = JSON.parse(response.body, symbolize_names: true)

expect(response.status).to eq(200)
expect(json[:healthy]).to eq(true)
expect(json[:statuses][:database][:healthy]).to eq(true)
expect(json[:statuses][:account_reset][:healthy]).to eq(true)
end
end

context 'when one resource is unhealthy' do
it 'returns an unsuccessful JSON response' do
allow(DatabaseHealthChecker).to receive(:simple_query).
and_raise(RuntimeError.new('canceling statement due to statement timeout'))
allow(AccountResetHealthChecker).to receive(:check).
and_return(HealthCheckSummary.new(healthy: true, result: 'foo'))

get :index
json = JSON.parse(response.body, symbolize_names: true)

expect(json[:healthy]).to eq(false)
expect(json[:statuses][:database][:result]).
to include('canceling statement due to statement timeout')
expect(json[:statuses][:account_reset][:healthy]).to eq(true)
expect(response.status).to eq(500)
end
end
Expand All @@ -40,16 +34,13 @@
it 'returns an unsuccessful JSON response' do
allow(DatabaseHealthChecker).to receive(:simple_query).
and_raise(RuntimeError.new('canceling statement due to statement timeout'))
allow(AccountResetHealthChecker).to receive(:check).
and_return(HealthCheckSummary.new(healthy: false, result: 'foo'))

get :index
json = JSON.parse(response.body, symbolize_names: true)

expect(json[:healthy]).to eq(false)
expect(json[:statuses][:database][:result]).
to include('canceling statement due to statement timeout')
expect(json[:statuses][:account_reset][:healthy]).to eq(false)
expect(response.status).to eq(500)
end
end
Expand Down
64 changes: 0 additions & 64 deletions spec/services/account_reset_health_checker_spec.rb

This file was deleted.