diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2019-05-07 18:37:50 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2019-05-07 18:37:50 +0300 |
commit | 22f49d1656cfa27105958e380a3519fddf122d20 (patch) | |
tree | 6da77af72cb95aa558de23b8005c46112d4c0d26 /spec/features | |
parent | 91acefb1f4ee4f747d4679d9c395a8c8dc33d6de (diff) | |
parent | 61cb27b01daa1ba7016d8dc4bf5f0e3472756bc5 (diff) |
Merge branch '60462-empty-pipeline-section' into 'master'
Fixes empty block in MR widget
Closes #60462
See merge request gitlab-org/gitlab-ce!27462
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/merge_request/user_sees_merge_widget_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/features/merge_request/user_sees_merge_widget_spec.rb b/spec/features/merge_request/user_sees_merge_widget_spec.rb index 40ba676ff92..a32c6bdcf8f 100644 --- a/spec/features/merge_request/user_sees_merge_widget_spec.rb +++ b/spec/features/merge_request/user_sees_merge_widget_spec.rb @@ -670,4 +670,26 @@ describe 'Merge request > User sees merge widget', :js do end end end + + context 'when MR has pipeline but user does not have permission' do + let(:sha) { project.commit(merge_request.source_branch).sha } + let!(:pipeline) { create(:ci_pipeline_without_jobs, status: 'success', sha: sha, project: project, ref: merge_request.source_branch) } + + before do + project.update( + visibility_level: Gitlab::VisibilityLevel::PUBLIC, + public_builds: false + ) + merge_request.update!(head_pipeline: pipeline) + sign_out(:user) + + visit project_merge_request_path(project, merge_request) + end + + it 'renders a CI pipeline error' do + within '.ci-widget' do + expect(page).to have_content('Could not retrieve the pipeline status.') + end + end + end end |