diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-23 18:42:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-23 18:42:02 +0000 |
commit | 5a1541a44f745cf9ae4121d6919a1530a7212afe (patch) | |
tree | 3841ea24d9eaa1e5521f168348af3fd409aab962 /spec/requests/api/lint_spec.rb | |
parent | f1bc6c9f752e5dcf11f5798c70498e9ae4a8e3ec (diff) | |
download | gitlab-ce-5a1541a44f745cf9ae4121d6919a1530a7212afe.tar.gz |
Add latest changes from gitlab-org/gitlab@13-9-stable-ee
Diffstat (limited to 'spec/requests/api/lint_spec.rb')
-rw-r--r-- | spec/requests/api/lint_spec.rb | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/spec/requests/api/lint_spec.rb b/spec/requests/api/lint_spec.rb index 2316e702c3e..b5bf697e9e3 100644 --- a/spec/requests/api/lint_spec.rb +++ b/spec/requests/api/lint_spec.rb @@ -5,7 +5,9 @@ require 'spec_helper' RSpec.describe API::Lint do describe 'POST /ci/lint' do context 'when signup settings are disabled' do - Gitlab::CurrentSettings.signup_enabled = false + before do + Gitlab::CurrentSettings.signup_enabled = false + end context 'when unauthenticated' do it 'returns authentication error' do @@ -16,22 +18,25 @@ RSpec.describe API::Lint do end context 'when authenticated' do - it 'returns unauthorized error' do - post api('/ci/lint'), params: { content: 'content' } + let_it_be(:api_user) { create(:user) } + it 'returns authorized' do + post api('/ci/lint', api_user), params: { content: 'content' } - expect(response).to have_gitlab_http_status(:unauthorized) + expect(response).to have_gitlab_http_status(:ok) end end end context 'when signup settings are enabled' do - Gitlab::CurrentSettings.signup_enabled = true + before do + Gitlab::CurrentSettings.signup_enabled = true + end context 'when unauthenticated' do - it 'returns authentication error' do + it 'returns authorized success' do post api('/ci/lint'), params: { content: 'content' } - expect(response).to have_gitlab_http_status(:unauthorized) + expect(response).to have_gitlab_http_status(:ok) end end |