diff options
Diffstat (limited to 'spec/features/projects/pipelines/pipelines_spec.rb')
-rw-r--r-- | spec/features/projects/pipelines/pipelines_spec.rb | 89 |
1 files changed, 44 insertions, 45 deletions
diff --git a/spec/features/projects/pipelines/pipelines_spec.rb b/spec/features/projects/pipelines/pipelines_spec.rb index 9037aa5c9a8..e375bc10dbf 100644 --- a/spec/features/projects/pipelines/pipelines_spec.rb +++ b/spec/features/projects/pipelines/pipelines_spec.rb @@ -14,7 +14,6 @@ RSpec.describe 'Pipelines', :js do sign_in(user) stub_feature_flags(graphql_pipeline_details: false) stub_feature_flags(graphql_pipeline_details_users: false) - stub_feature_flags(new_pipelines_table: false) project.add_developer(user) project.update!(auto_devops_attributes: { enabled: false }) @@ -94,12 +93,12 @@ RSpec.describe 'Pipelines', :js do wait_for_requests end - it 'renders run pipeline link' do - expect(page).to have_link('Run Pipeline') + it 'renders "CI lint" link' do + expect(page).to have_link('CI lint') end - it 'renders ci lint link' do - expect(page).to have_link('CI Lint') + it 'renders "Run pipeline" link' do + expect(page).to have_link('Run pipeline') end end @@ -534,7 +533,7 @@ RSpec.describe 'Pipelines', :js do end it 'renders a mini pipeline graph' do - expect(page).to have_selector('[data-testid="widget-mini-pipeline-graph"]') + expect(page).to have_selector('[data-testid="pipeline-mini-graph"]') expect(page).to have_selector(dropdown_selector) end @@ -677,7 +676,7 @@ RSpec.describe 'Pipelines', :js do end it 'creates a new pipeline' do - expect { click_on 'Run Pipeline' } + expect { click_on 'Run pipeline' } .to change { Ci::Pipeline.count }.by(1) expect(Ci::Pipeline.last).to be_web @@ -690,7 +689,7 @@ RSpec.describe 'Pipelines', :js do fill_in "Input variable value", with: "value" end - expect { click_on 'Run Pipeline' } + expect { click_on 'Run pipeline' } .to change { Ci::Pipeline.count }.by(1) expect(Ci::Pipeline.last.variables.map { |var| var.slice(:key, :secret_value) }) @@ -701,7 +700,7 @@ RSpec.describe 'Pipelines', :js do context 'without gitlab-ci.yml' do before do - click_on 'Run Pipeline' + click_on 'Run pipeline' end it { expect(page).to have_content('Missing CI config file') } @@ -714,44 +713,13 @@ RSpec.describe 'Pipelines', :js do click_link 'master' end - expect { click_on 'Run Pipeline' } + expect { click_on 'Run pipeline' } .to change { Ci::Pipeline.count }.by(1) end end end end - describe 'Run Pipelines' do - let(:project) { create(:project, :repository) } - - before do - stub_feature_flags(new_pipeline_form: false) - visit new_project_pipeline_path(project) - end - - describe 'new pipeline page' do - it 'has field to add a new pipeline' do - expect(page).to have_selector('.js-branch-select') - expect(find('.js-branch-select')).to have_content project.default_branch - expect(page).to have_content('Run for') - end - end - - describe 'find pipelines' do - it 'shows filtered pipelines', :js do - click_button project.default_branch - - page.within '.dropdown-menu' do - find('.dropdown-input-field').native.send_keys('fix') - - page.within '.dropdown-content' do - expect(page).to have_content('fix') - end - end - end - end - end - describe 'Reset runner caches' do let(:project) { create(:project, :repository) } @@ -762,17 +730,17 @@ RSpec.describe 'Pipelines', :js do end it 'has a clear caches button' do - expect(page).to have_button 'Clear Runner Caches' + expect(page).to have_button 'Clear runner caches' end describe 'user clicks the button' do context 'when project already has jobs_cache_index' do before do - project.update(jobs_cache_index: 1) + project.update!(jobs_cache_index: 1) end it 'increments jobs_cache_index' do - click_button 'Clear Runner Caches' + click_button 'Clear runner caches' wait_for_requests expect(page.find('.flash-notice')).to have_content 'Project cache successfully reset.' end @@ -780,7 +748,7 @@ RSpec.describe 'Pipelines', :js do context 'when project does not have jobs_cache_index' do it 'sets jobs_cache_index to 1' do - click_button 'Clear Runner Caches' + click_button 'Clear runner caches' wait_for_requests expect(page.find('.flash-notice')).to have_content 'Project cache successfully reset.' end @@ -788,6 +756,37 @@ RSpec.describe 'Pipelines', :js do end end + describe 'Run Pipelines' do + let(:project) { create(:project, :repository) } + + before do + stub_feature_flags(new_pipeline_form: false) + visit new_project_pipeline_path(project) + end + + describe 'new pipeline page' do + it 'has field to add a new pipeline' do + expect(page).to have_selector('.js-branch-select') + expect(find('.js-branch-select')).to have_content project.default_branch + expect(page).to have_content('Run for') + end + end + + describe 'find pipelines' do + it 'shows filtered pipelines', :js do + click_button project.default_branch + + page.within '.dropdown-menu' do + find('.dropdown-input-field').native.send_keys('fix') + + page.within '.dropdown-content' do + expect(page).to have_content('fix') + end + end + end + end + end + describe 'Empty State' do let(:project) { create(:project, :repository) } |