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>2022-01-04 15:13:46 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-01-04 15:13:46 +0300
commit76893705a1df96909da44ab3c99816fd12129206 (patch)
treee9ec48a022223fbdf7588a6e2bbafd5dff22903a /spec/requests/api/lint_spec.rb
parentcb19d2b6a3b6becdede8d9398fbd17dedb99a8bf (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.rb19
1 files changed, 16 insertions, 3 deletions
diff --git a/spec/requests/api/lint_spec.rb b/spec/requests/api/lint_spec.rb
index 0e83b964121..7c1e731a99a 100644
--- a/spec/requests/api/lint_spec.rb
+++ b/spec/requests/api/lint_spec.rb
@@ -121,8 +121,8 @@ RSpec.describe API::Lint do
expect(response).to have_gitlab_http_status(:ok)
expect(json_response).to be_an Hash
expect(json_response['status']).to eq('valid')
- expect(json_response['warnings']).to eq([])
- expect(json_response['errors']).to eq([])
+ expect(json_response['warnings']).to match_array([])
+ expect(json_response['errors']).to match_array([])
end
it 'outputs expanded yaml content' do
@@ -149,7 +149,20 @@ RSpec.describe API::Lint do
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['status']).to eq('valid')
expect(json_response['warnings']).not_to be_empty
- expect(json_response['errors']).to eq([])
+ expect(json_response['errors']).to match_array([])
+ end
+ end
+
+ context 'with valid .gitlab-ci.yaml using deprecated keywords' do
+ let(:yaml_content) { { job: { script: 'ls' }, types: ['test'] }.to_yaml }
+
+ it 'passes validation but returns warnings' do
+ post api('/ci/lint', api_user), params: { content: yaml_content }
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(json_response['status']).to eq('valid')
+ expect(json_response['warnings']).not_to be_empty
+ expect(json_response['errors']).to match_array([])
end
end