diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/features/merge_request/user_sees_pipelines_spec.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) | |
download | gitlab-ce-6e4e1050d9dba2b7b2523fdd1768823ab85feef4.tar.gz |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/features/merge_request/user_sees_pipelines_spec.rb')
-rw-r--r-- | spec/features/merge_request/user_sees_pipelines_spec.rb | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/spec/features/merge_request/user_sees_pipelines_spec.rb b/spec/features/merge_request/user_sees_pipelines_spec.rb index d693eec91c8..5d41e49c478 100644 --- a/spec/features/merge_request/user_sees_pipelines_spec.rb +++ b/spec/features/merge_request/user_sees_pipelines_spec.rb @@ -123,14 +123,24 @@ RSpec.describe 'Merge request > User sees pipelines', :js do context 'when actor is a developer in parent project' do let(:actor) { developer_in_parent } - it 'creates a pipeline in the parent project' do + it 'creates a pipeline in the parent project when user proceeds with the warning' do visit project_merge_request_path(parent_project, merge_request) create_merge_request_pipeline + act_on_security_warning(action: 'Run Pipeline') check_pipeline(expected_project: parent_project) check_head_pipeline(expected_project: parent_project) end + + it 'does not create a pipeline in the parent project when user cancels the action' do + visit project_merge_request_path(parent_project, merge_request) + + create_merge_request_pipeline + act_on_security_warning(action: 'Cancel') + + check_no_pipelines + end end context 'when actor is a developer in fork project' do @@ -187,6 +197,19 @@ RSpec.describe 'Merge request > User sees pipelines', :js do expect(page.find('.pipeline-id')[:href]).to include(expected_project.full_path) end end + + def act_on_security_warning(action:) + page.within('#create-pipeline-for-fork-merge-request-modal') do + expect(page).to have_content('Are you sure you want to run this pipeline?') + click_button(action) + end + end + + def check_no_pipelines + page.within('.ci-table') do + expect(page).to have_selector('.commit', count: 1) + end + end end describe 'race condition' do |