Commit 063f03b9 authored by Pawel Chojnacki's avatar Pawel Chojnacki

Differentiate shared test context using options hash instead of subject.

+ fix typos, and capitalization
+ point configuration to `gitlab.rb` as well
parent 2951a099
...@@ -16,8 +16,8 @@ traffic until the system is ready or restart the container as needed. ...@@ -16,8 +16,8 @@ traffic until the system is ready or restart the container as needed.
## IP Whitelist ## IP Whitelist
To access monitoring resources client IP needs to be included in the whitelist. To access monitoring resources the client IP needs to be included in the whitelist.
To add or remove hosts or ip ranges from the list you can edit `gitlab.yml`. To add or remove hosts or IP ranges from the list you can edit `gitlab.rb` or `gitlab.yml`.
Example whitelist configuration: Example whitelist configuration:
```yaml ```yaml
......
...@@ -36,7 +36,7 @@ describe HealthCheckController do ...@@ -36,7 +36,7 @@ describe HealthCheckController do
expect(response.content_type).to eq 'text/plain' expect(response.content_type).to eq 'text/plain'
end end
it 'supports successful plaintest response' do it 'supports passing the token in query params' do
get :index, token: token get :index, token: token
expect(response).to be_success expect(response).to be_success
...@@ -50,7 +50,7 @@ describe HealthCheckController do ...@@ -50,7 +50,7 @@ describe HealthCheckController do
allow(Gitlab::RequestContext).to receive(:client_ip).and_return(whitelisted_ip) allow(Gitlab::RequestContext).to receive(:client_ip).and_return(whitelisted_ip)
end end
it 'supports successful plaintest response' do it 'supports successful plaintext response' do
get :index get :index
expect(response).to be_success expect(response).to be_success
...@@ -97,7 +97,7 @@ describe HealthCheckController do ...@@ -97,7 +97,7 @@ describe HealthCheckController do
allow(Gitlab::RequestContext).to receive(:client_ip).and_return(whitelisted_ip) allow(Gitlab::RequestContext).to receive(:client_ip).and_return(whitelisted_ip)
end end
it 'supports failure plaintest response' do it 'supports failure plaintext response' do
get :index get :index
expect(response).to have_http_status(500) expect(response).to have_http_status(500)
......
...@@ -15,7 +15,9 @@ describe HealthController do ...@@ -15,7 +15,9 @@ describe HealthController do
describe '#readiness' do describe '#readiness' do
shared_context 'endpoint responding with readiness data' do shared_context 'endpoint responding with readiness data' do
subject { get :readiness } let(:request_params) { {} }
subject { get :readiness, request_params }
it 'responds with readiness checks data' do it 'responds with readiness checks data' do
subject subject
...@@ -58,7 +60,7 @@ describe HealthController do ...@@ -58,7 +60,7 @@ describe HealthController do
context 'token passed as URL param' do context 'token passed as URL param' do
it_behaves_like 'endpoint responding with readiness data' do it_behaves_like 'endpoint responding with readiness data' do
subject { get :readiness, token: token } let(:request_params) { { token: token } }
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment