diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-12 19:26:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-12 19:26:10 +0300 |
commit | 6653ccc011dec86e5140a5d09ea3b2357eab6714 (patch) | |
tree | 897193f37bcd98152a0ac214f80a3c4cfe1047c5 /spec/requests/api/lint_spec.rb | |
parent | bff35a05aed6a31380a73c39113808fd262c2c37 (diff) |
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc41
Diffstat (limited to 'spec/requests/api/lint_spec.rb')
-rw-r--r-- | spec/requests/api/lint_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/requests/api/lint_spec.rb b/spec/requests/api/lint_spec.rb index b5bf697e9e3..cf8cac773f5 100644 --- a/spec/requests/api/lint_spec.rb +++ b/spec/requests/api/lint_spec.rb @@ -406,6 +406,24 @@ RSpec.describe API::Lint do end end + context 'with an empty repository' do + let_it_be(:empty_project) { create(:project_empty_repo) } + let_it_be(:yaml_content) do + File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) + end + + before do + empty_project.add_developer(api_user) + end + + it 'passes validation without errors' do + post api("/projects/#{empty_project.id}/ci/lint", api_user), params: { content: yaml_content } + expect(response).to have_gitlab_http_status(:ok) + expect(json_response['valid']).to eq(true) + expect(json_response['errors']).to eq([]) + end + end + context 'when unauthenticated' do let_it_be(:api_user) { nil } |