diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/features/projects/ci/lint_spec.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/features/projects/ci/lint_spec.rb')
-rw-r--r-- | spec/features/projects/ci/lint_spec.rb | 50 |
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 |