diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-10-04 14:52:14 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-10-04 14:52:14 +0300 |
commit | 4741c07f3fa61326665c36d4b9974025bf9dd9e9 (patch) | |
tree | 75ae7036be53f504e0a26c3e3a77d68fb7ec6657 /spec/features/projects | |
parent | e4ed981f3304dba0eb54bb08efaea6222815f9d0 (diff) |
Groomed specs
Diffstat (limited to 'spec/features/projects')
-rw-r--r-- | spec/features/projects/jobs_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/projects/pipelines/pipeline_spec.rb | 18 | ||||
-rw-r--r-- | spec/features/projects/pipelines/pipelines_spec.rb | 19 |
3 files changed, 21 insertions, 18 deletions
diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb index 45fc492f23f..6a7bf0860e9 100644 --- a/spec/features/projects/jobs_spec.rb +++ b/spec/features/projects/jobs_spec.rb @@ -574,7 +574,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do expect(page).to have_link('Unschedule job') end - it 'unschedule delayed job and shows manual action', :js do + it 'unschedules delayed job and shows manual action', :js do click_link 'Unschedule job' wait_for_requests diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index e6cb137b023..491c64fc329 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -84,7 +84,7 @@ describe 'Pipeline', :js do end end - it 'should be possible to cancel the running build' do + it 'cancels the running build and shows retry button' do find('#ci-badge-deploy .ci-action-icon-container').click page.within('#ci-badge-deploy') do @@ -112,8 +112,8 @@ describe 'Pipeline', :js do end end - context 'when pipeline has scheduled builds' do - it 'shows the scheduled icon and a unschedule action for the scheduled build' do + context 'when pipeline has a delayed job' do + it 'shows the scheduled icon and an unschedule action for the delayed job' do page.within('#ci-badge-delayed-job') do expect(page).to have_selector('.js-ci-status-icon-scheduled') expect(page).to have_content('delayed-job') @@ -124,10 +124,12 @@ describe 'Pipeline', :js do end end - it 'should be possible to unschedule the scheduled job' do + it 'unschedules the delayed job and shows play button as a manual job' do find('#ci-badge-delayed-job .ci-action-icon-container').click - expect(page).not_to have_content('Unschedule job') + page.within('#ci-badge-delayed-job') do + expect(page).to have_css('.js-icon-play') + end end end @@ -341,14 +343,16 @@ describe 'Pipeline', :js do it { expect(build_manual.reload).to be_pending } end - context 'unscheduling scheduled job' do + context 'when user unschedules a delayed job' do before do within '.pipeline-holder' do click_link('Unschedule') end end - it { expect(build_scheduled.reload).to be_manual } + it 'unschedules the delayed job and shows play button as a manual job' do + expect(page).to have_content('Trigger this manual action') + end end context 'failed jobs' do diff --git a/spec/features/projects/pipelines/pipelines_spec.rb b/spec/features/projects/pipelines/pipelines_spec.rb index 43f9608e8e3..f6197a31ee1 100644 --- a/spec/features/projects/pipelines/pipelines_spec.rb +++ b/spec/features/projects/pipelines/pipelines_spec.rb @@ -232,7 +232,7 @@ describe 'Pipelines', :js do end end - context 'with delayed job' do + context 'when there is a delayed job' do let!(:delayed_job) do create(:ci_build, :scheduled, pipeline: pipeline, @@ -245,26 +245,25 @@ describe 'Pipelines', :js do visit_project_pipelines end - it 'has a dropdown with play button' do + it 'has a dropdown for actionable jobs' do expect(page).to have_selector('.dropdown-new.btn.btn-default .icon-play') end - it 'has link to the scheduled action' do + it "has link to the delayed job's action" do find('.js-pipeline-dropdown-manual-actions').click expect(page).to have_button('delayed job') end - context 'when scheduled action was played' do + context 'when user played a delayed job immediately' do before do - accept_confirm do - find('.js-pipeline-dropdown-manual-actions').click - click_button('delayed job') - end + find('.js-pipeline-dropdown-manual-actions').click + page.accept_confirm { click_button('delayed job') } + wait_for_requests end - it 'enqueues scheduled action job' do - expect(page).to have_selector('.js-pipeline-dropdown-manual-actions:disabled') + it 'enqueues the delayed job', :js do + expect(delayed_job.reload).to be_pending end end end |