diff options
author | DJ Mountney <david@twkie.net> | 2016-05-12 03:27:08 +0300 |
---|---|---|
committer | DJ Mountney <david@twkie.net> | 2016-05-12 03:27:08 +0300 |
commit | c8f23bd2edc19f968446b149120df1f7798eb4b1 (patch) | |
tree | 1b922eff4ebae5350ce4d44417877ef05993bfa1 /spec/controllers/health_check_controller_spec.rb | |
parent | 0e0caf4d17c28b6b0f3488b25efa265ce2804cc4 (diff) |
Support token header for health check token, and general cleanup of the health_check feature.
Diffstat (limited to 'spec/controllers/health_check_controller_spec.rb')
-rw-r--r-- | spec/controllers/health_check_controller_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/controllers/health_check_controller_spec.rb b/spec/controllers/health_check_controller_spec.rb index 3b9cc5c98f5..0d8a68bb51a 100644 --- a/spec/controllers/health_check_controller_spec.rb +++ b/spec/controllers/health_check_controller_spec.rb @@ -14,6 +14,13 @@ describe HealthCheckController do end context 'when services are up and an access token is provided' do + it 'supports passing the token in the header' do + request.headers['TOKEN'] = token + get :index + expect(response).to be_success + expect(response.content_type).to eq 'text/plain' + end + it 'supports successful plaintest response' do get :index, token: token expect(response).to be_success @@ -55,6 +62,14 @@ describe HealthCheckController do allow(HealthCheck::Utils).to receive(:process_checks).with('email').and_return('Email is on fire') end + it 'supports passing the token in the header' do + request.headers['TOKEN'] = token + get :index + expect(response.status).to eq(500) + expect(response.content_type).to eq 'text/plain' + expect(response.body).to include('The server is on fire') + end + it 'supports failure plaintest response' do get :index, token: token expect(response.status).to eq(500) |