diff options
author | Phil Hughes <me@iamphill.com> | 2018-03-06 09:08:30 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-03-06 09:08:30 +0000 |
commit | 60d95d8f24c64633fc5facb68ee3e77c0ae639b2 (patch) | |
tree | 297aa3e0b0a35befff5345dbdce2b24f20b092a0 /spec/features | |
parent | a28045124f33c67068246df91d9c0ca17c3ad035 (diff) | |
parent | e3251a4077d4667239b23437921f49a1d195406c (diff) | |
download | gitlab-ce-60d95d8f24c64633fc5facb68ee3e77c0ae639b2.tar.gz |
Merge branch '38587-pipelines-empty-state' into 'master'
Resolve "Pipelines view should handle empty state and buttons properly"
Closes #38587
See merge request gitlab-org/gitlab-ce!17433
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/projects/pipelines/pipelines_spec.rb | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/spec/features/projects/pipelines/pipelines_spec.rb b/spec/features/projects/pipelines/pipelines_spec.rb index 3a8e7c05cc4..849d85061df 100644 --- a/spec/features/projects/pipelines/pipelines_spec.rb +++ b/spec/features/projects/pipelines/pipelines_spec.rb @@ -86,7 +86,22 @@ describe 'Pipelines', :js do it 'updates content when tab is clicked' do page.find('.js-pipelines-tab-pending').click wait_for_requests - expect(page).to have_content('No pipelines to show.') + expect(page).to have_content('There are currently no pending pipelines.') + end + end + + context 'navigation links' do + before do + visit project_pipelines_path(project) + wait_for_requests + end + + it 'renders run pipeline link' do + expect(page).to have_link('Run Pipeline') + end + + it 'renders ci lint link' do + expect(page).to have_link('CI Lint') end end @@ -542,7 +557,7 @@ describe 'Pipelines', :js do end it 'has a clear caches button' do - expect(page).to have_link 'Clear runner caches' + expect(page).to have_link 'Clear Runner Caches' end describe 'user clicks the button' do @@ -552,19 +567,31 @@ describe 'Pipelines', :js do end it 'increments jobs_cache_index' do - click_link 'Clear runner caches' + click_link 'Clear Runner Caches' expect(page.find('.flash-notice')).to have_content 'Project cache successfully reset.' end end context 'when project does not have jobs_cache_index' do it 'sets jobs_cache_index to 1' do - click_link 'Clear runner caches' + click_link 'Clear Runner Caches' expect(page.find('.flash-notice')).to have_content 'Project cache successfully reset.' end end end end + + describe 'Empty State' do + let(:project) { create(:project, :repository) } + + before do + visit project_pipelines_path(project) + end + + it 'renders empty state' do + expect(page).to have_content 'Build with confidence' + end + end end context 'when user is not logged in' do @@ -575,7 +602,9 @@ describe 'Pipelines', :js do context 'when project is public' do let(:project) { create(:project, :public, :repository) } - it { expect(page).to have_content 'Build with confidence' } + context 'without pipelines' do + it { expect(page).to have_content 'This project is not currently set up to run pipelines.' } + end end context 'when project is private' do |