Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZ.J. van de Weg <zegerjan@gitlab.com>2016-06-27 21:10:42 +0300
committerZ.J. van de Weg <zegerjan@gitlab.com>2016-06-27 21:10:42 +0300
commitabca19da8b0ec12548140f8e771cfc08968d6972 (patch)
tree1db15dba43c2f51a423b8f71a1dbb87e5ea332e2 /spec/controllers/health_check_controller_spec.rb
parente0e325625eb141445720999d4e4a4d60a4b59d95 (diff)
Use HTTP matchers if possible
Diffstat (limited to 'spec/controllers/health_check_controller_spec.rb')
-rw-r--r--spec/controllers/health_check_controller_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/controllers/health_check_controller_spec.rb b/spec/controllers/health_check_controller_spec.rb
index 0d8a68bb51a..56ecf2bb644 100644
--- a/spec/controllers/health_check_controller_spec.rb
+++ b/spec/controllers/health_check_controller_spec.rb
@@ -65,21 +65,21 @@ describe HealthCheckController do
it 'supports passing the token in the header' do
request.headers['TOKEN'] = token
get :index
- expect(response.status).to eq(500)
+ expect(response).to have_http_status(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)
+ expect(response).to have_http_status(500)
expect(response.content_type).to eq 'text/plain'
expect(response.body).to include('The server is on fire')
end
it 'supports failure json response' do
get :index, token: token, format: :json
- expect(response.status).to eq(500)
+ expect(response).to have_http_status(500)
expect(response.content_type).to eq 'application/json'
expect(json_response['healthy']).to be false
expect(json_response['message']).to include('The server is on fire')
@@ -87,7 +87,7 @@ describe HealthCheckController do
it 'supports failure xml response' do
get :index, token: token, format: :xml
- expect(response.status).to eq(500)
+ expect(response).to have_http_status(500)
expect(response.content_type).to eq 'application/xml'
expect(xml_response['healthy']).to be false
expect(xml_response['message']).to include('The server is on fire')
@@ -95,7 +95,7 @@ describe HealthCheckController do
it 'supports failure responses for specific checks' do
get :index, token: token, checks: 'email', format: :json
- expect(response.status).to eq(500)
+ expect(response).to have_http_status(500)
expect(response.content_type).to eq 'application/json'
expect(json_response['healthy']).to be false
expect(json_response['message']).to include('Email is on fire')