0fd4a6b637
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"} ```
25 lines
631 B
Ruby
25 lines
631 B
Ruby
require 'spec_helper'
|
|
|
|
describe API::Version do
|
|
describe 'GET /version' do
|
|
context 'when unauthenticated' do
|
|
it 'returns authentication error' do
|
|
get api('/version')
|
|
|
|
expect(response).to have_gitlab_http_status(401)
|
|
end
|
|
end
|
|
|
|
context 'when authenticated' do
|
|
let(:user) { create(:user) }
|
|
|
|
it 'returns the version information' do
|
|
get api('/version', user)
|
|
|
|
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
|
|
end
|
|
end
|
|
end
|