summaryrefslogtreecommitdiff
path: root/spec/features/projects/ci
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-12 15:10:02 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-12 15:10:02 +0000
commitf6a3028be7c20cd509685258ba7e50d9d6a68114 (patch)
tree82960188ccaca3f08a3b3e45b33010ad523230cc /spec/features/projects/ci
parent999f47e9e6da399de9dc1de404f073f7dd30af0d (diff)
downloadgitlab-ce-f6a3028be7c20cd509685258ba7e50d9d6a68114.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/projects/ci')
-rw-r--r--spec/features/projects/ci/lint_spec.rb50
1 files changed, 33 insertions, 17 deletions
diff --git a/spec/features/projects/ci/lint_spec.rb b/spec/features/projects/ci/lint_spec.rb
index f3845bb8dec..ba063acbe70 100644
--- a/spec/features/projects/ci/lint_spec.rb
+++ b/spec/features/projects/ci/lint_spec.rb
@@ -21,32 +21,48 @@ RSpec.describe 'CI Lint', :js do
end
describe 'YAML parsing' do
- before do
- click_on 'Validate'
- end
+ shared_examples 'validates the YAML' do
+ before do
+ click_on 'Validate'
+ end
- context 'YAML is correct' do
- let(:yaml_content) do
- File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml'))
+ context 'YAML is correct' do
+ let(:yaml_content) do
+ File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml'))
+ end
+
+ it 'parses Yaml and displays the jobs' do
+ expect(page).to have_content('Status: syntax is correct')
+
+ within "table" do
+ aggregate_failures do
+ expect(page).to have_content('Job - rspec')
+ expect(page).to have_content('Job - spinach')
+ expect(page).to have_content('Deploy Job - staging')
+ expect(page).to have_content('Deploy Job - production')
+ end
+ end
+ end
end
- it 'parses Yaml' do
- within "table" do
- expect(page).to have_content('Job - rspec')
- expect(page).to have_content('Job - spinach')
- expect(page).to have_content('Deploy Job - staging')
- expect(page).to have_content('Deploy Job - production')
+ context 'YAML is incorrect' do
+ let(:yaml_content) { 'value: cannot have :' }
+
+ it 'displays information about an error' do
+ expect(page).to have_content('Status: syntax is incorrect')
+ expect(page).to have_selector('.ace_content', text: yaml_content)
end
end
end
- context 'YAML is incorrect' do
- let(:yaml_content) { 'value: cannot have :' }
+ it_behaves_like 'validates the YAML'
- it 'displays information about an error' do
- expect(page).to have_content('Status: syntax is incorrect')
- expect(page).to have_selector('.ace_content', text: yaml_content)
+ context 'when Dry Run is checked' do
+ before do
+ check 'Simulate a pipeline created for the default branch'
end
+
+ it_behaves_like 'validates the YAML'
end
describe 'YAML revalidate' do