diff options
Diffstat (limited to 'spec/features/dashboard/projects_spec.rb')
-rw-r--r-- | spec/features/dashboard/projects_spec.rb | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/spec/features/dashboard/projects_spec.rb b/spec/features/dashboard/projects_spec.rb index f10cdf6da1e..73f759f8a54 100644 --- a/spec/features/dashboard/projects_spec.rb +++ b/spec/features/dashboard/projects_spec.rb @@ -173,6 +173,19 @@ describe 'Dashboard Projects' do end end + shared_examples 'hidden pipeline status' do + it 'does not show the pipeline status' do + visit dashboard_projects_path + + page.within('.controls') do + expect(page).not_to have_xpath("//a[@href='#{pipelines_project_commit_path(project, project.commit, ref: pipeline.ref)}']") + expect(page).not_to have_css('.ci-status-link') + expect(page).not_to have_css('.ci-status-icon-success') + expect(page).not_to have_link('Pipeline: passed') + end + end + end + context 'guest user of project and project has private pipelines' do let(:guest_user) { create(:user) } @@ -182,16 +195,15 @@ describe 'Dashboard Projects' do sign_in(guest_user) end - it 'shows that the last pipeline passed' do - visit dashboard_projects_path + it_behaves_like 'hidden pipeline status' + end - page.within('.controls') do - expect(page).not_to have_xpath("//a[@href='#{pipelines_project_commit_path(project, project.commit, ref: pipeline.ref)}']") - expect(page).not_to have_css('.ci-status-link') - expect(page).not_to have_css('.ci-status-icon-success') - expect(page).not_to have_link('Pipeline: passed') - end + context 'when dashboard_pipeline_status is disabled' do + before do + stub_feature_flags(dashboard_pipeline_status: false) end + + it_behaves_like 'hidden pipeline status' end end |