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-03-10 21:09:32 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-10 21:09:32 +0300
commitbac259ea8bb39318d1e2379b2099dbd2393b8f7a (patch)
tree61fa955f49b8f1ecd68bd247531f879231ffc208 /spec/requests/api/lint_spec.rb
parentd2091d1e924e2887eb9db4fad761965a24d024f1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api/lint_spec.rb')
-rw-r--r--spec/requests/api/lint_spec.rb18
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 }