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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-23 21:42:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-23 21:42:02 +0300
commit5a1541a44f745cf9ae4121d6919a1530a7212afe (patch)
tree3841ea24d9eaa1e5521f168348af3fd409aab962 /spec/requests
parentf1bc6c9f752e5dcf11f5798c70498e9ae4a8e3ec (diff)
Add latest changes from gitlab-org/gitlab@13-9-stable-ee
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/lint_spec.rb19
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