summaryrefslogtreecommitdiff
path: root/spec/requests/api/version_spec.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-07-15 01:43:26 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-07-15 01:43:26 +0800
commit0fd4a6b637e30adc9855e7cea1c53c4767fcefcb (patch)
tree9588f7bb7a6b757410c31512dec65558a7329912 /spec/requests/api/version_spec.rb
parent0f393724e7de8d764577b6622ccf43964539cb2b (diff)
downloadgitlab-ce-0fd4a6b637e30adc9855e7cea1c53c4767fcefcb.tar.gz
Introduce have_gitlab_http_status34964-have_gitlab_http_status
So that whenever this failed: expect(response).to have_gitlab_http_status(200) We see what's the response there. Here's an example: ``` 1) API::Settings Settings PUT /application/settings custom repository storage type set in the config updates application settings Failure/Error: expect(response).to have_gitlab_http_status(200) expected the response to have status code 200 but it was 400. The response was: {"error":"password_authentication_enabled, signin_enabled are mutually exclusive"} ```
Diffstat (limited to 'spec/requests/api/version_spec.rb')
-rw-r--r--spec/requests/api/version_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/requests/api/version_spec.rb b/spec/requests/api/version_spec.rb
index 8870d48bbc9..7bbf34422b8 100644
--- a/spec/requests/api/version_spec.rb
+++ b/spec/requests/api/version_spec.rb
@@ -6,7 +6,7 @@ describe API::Version do
it 'returns authentication error' do
get api('/version')
- expect(response).to have_http_status(401)
+ expect(response).to have_gitlab_http_status(401)
end
end
@@ -16,7 +16,7 @@ describe API::Version do
it 'returns the version information' do
get api('/version', user)
- expect(response).to have_http_status(200)
+ expect(response).to have_gitlab_http_status(200)
expect(json_response['version']).to eq(Gitlab::VERSION)
expect(json_response['revision']).to eq(Gitlab::REVISION)
end