diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2018-04-11 12:04:35 -0500 |
---|---|---|
committer | Jose <jivanvl@hotmail.com> | 2018-04-20 12:48:04 -0500 |
commit | e40bc1b190f51ca42ac12d79b87a0338f2ab0357 (patch) | |
tree | 8ed142024111bedeff8bd9259baadfae7b4b82ed /spec | |
parent | ff77806150a0f965694d9492657e11f6891eba11 (diff) | |
download | gitlab-ce-e40bc1b190f51ca42ac12d79b87a0338f2ab0357.tar.gz |
Create autodevops settings sections
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/projects/settings/pipelines_settings_spec.rb | 24 | ||||
-rw-r--r-- | spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb | 8 | ||||
-rw-r--r-- | spec/javascripts/settings_panels_spec.js | 4 | ||||
-rw-r--r-- | spec/presenters/project_presenter_spec.rb | 2 | ||||
-rw-r--r-- | spec/views/projects/settings/ci_cd/_autodevops_form.html.haml_spec.rb (renamed from spec/views/projects/settings/ci_cd/_form.html.haml_spec.rb) | 2 |
5 files changed, 25 insertions, 15 deletions
diff --git a/spec/features/projects/settings/pipelines_settings_spec.rb b/spec/features/projects/settings/pipelines_settings_spec.rb index d9020333f28..340a5b222ee 100644 --- a/spec/features/projects/settings/pipelines_settings_spec.rb +++ b/spec/features/projects/settings/pipelines_settings_spec.rb @@ -27,10 +27,14 @@ describe "Projects > Settings > Pipelines settings" do visit project_settings_ci_cd_path(project) fill_in('Test coverage parsing', with: 'coverage_regex') - click_on 'Save changes' + page.within '.general-ci-settings' do + click_on 'Save changes' + end expect(page.status_code).to eq(200) - expect(page).to have_button('Save changes', disabled: false) + page.within '.general-ci-settings' do + expect(page).to have_button('Save changes', disabled: false) + end expect(page).to have_field('Test coverage parsing', with: 'coverage_regex') end @@ -38,10 +42,14 @@ describe "Projects > Settings > Pipelines settings" do visit project_settings_ci_cd_path(project) page.check('Auto-cancel redundant, pending pipelines') - click_on 'Save changes' + page.within '.general-ci-settings' do + click_on 'Save changes' + end expect(page.status_code).to eq(200) - expect(page).to have_button('Save changes', disabled: false) + page.within '.general-ci-settings' do + expect(page).to have_button('Save changes', disabled: false) + end checkbox = find_field('project_auto_cancel_pending_pipelines') expect(checkbox).to be_checked @@ -51,9 +59,11 @@ describe "Projects > Settings > Pipelines settings" do it 'update auto devops settings' do visit project_settings_ci_cd_path(project) - fill_in('project_auto_devops_attributes_domain', with: 'test.com') - page.choose('project_auto_devops_attributes_enabled_false') - click_on 'Save changes' + page.within '.autodevops-settings' do + fill_in('project_auto_devops_attributes_domain', with: 'test.com') + page.choose('project_auto_devops_attributes_enabled_false') + click_on 'Save changes' + end expect(page.status_code).to eq(200) expect(project.auto_devops).to be_present diff --git a/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb b/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb index a906fa20233..044cce75c00 100644 --- a/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb +++ b/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb @@ -65,7 +65,7 @@ describe 'Projects > Show > User sees setup shortcut buttons' do describe 'Auto DevOps button' do it '"Enable Auto DevOps" button linked to settings page' do page.within('.project-stats') do - expect(page).to have_link('Enable Auto DevOps', href: project_settings_ci_cd_path(project, anchor: 'js-general-pipeline-settings')) + expect(page).to have_link('Enable Auto DevOps', href: project_settings_ci_cd_path(project, anchor: 'js-autodevops-settings')) end end @@ -75,7 +75,7 @@ describe 'Projects > Show > User sees setup shortcut buttons' do visit project_path(project) page.within('.project-stats') do - expect(page).to have_link('Auto DevOps enabled', href: project_settings_ci_cd_path(project, anchor: 'js-general-pipeline-settings')) + expect(page).to have_link('Auto DevOps enabled', href: project_settings_ci_cd_path(project, anchor: 'js-autodevops-settings')) end end end @@ -212,7 +212,7 @@ describe 'Projects > Show > User sees setup shortcut buttons' do describe 'Auto DevOps button' do it '"Enable Auto DevOps" button linked to settings page' do page.within('.project-stats') do - expect(page).to have_link('Enable Auto DevOps', href: project_settings_ci_cd_path(project, anchor: 'js-general-pipeline-settings')) + expect(page).to have_link('Enable Auto DevOps', href: project_settings_ci_cd_path(project, anchor: 'js-autodevops-settings')) end end @@ -222,7 +222,7 @@ describe 'Projects > Show > User sees setup shortcut buttons' do visit project_path(project) page.within('.project-stats') do - expect(page).to have_link('Auto DevOps enabled', href: project_settings_ci_cd_path(project, anchor: 'js-general-pipeline-settings')) + expect(page).to have_link('Auto DevOps enabled', href: project_settings_ci_cd_path(project, anchor: 'js-autodevops-settings')) end end diff --git a/spec/javascripts/settings_panels_spec.js b/spec/javascripts/settings_panels_spec.js index d433f8c3e07..b22ef7373b3 100644 --- a/spec/javascripts/settings_panels_spec.js +++ b/spec/javascripts/settings_panels_spec.js @@ -13,9 +13,9 @@ describe('Settings Panels', () => { }); it('should expand linked hash fragment panel', () => { - location.hash = '#js-general-pipeline-settings'; + location.hash = '#js-autodevops-settings'; - const pipelineSettingsPanel = document.querySelector('#js-general-pipeline-settings'); + const pipelineSettingsPanel = document.querySelector('#js-autodevops-settings'); // Our test environment automatically expands everything so we need to clear that out first pipelineSettingsPanel.classList.remove('expanded'); diff --git a/spec/presenters/project_presenter_spec.rb b/spec/presenters/project_presenter_spec.rb index 55962f345d4..4c58817b349 100644 --- a/spec/presenters/project_presenter_spec.rb +++ b/spec/presenters/project_presenter_spec.rb @@ -321,7 +321,7 @@ describe ProjectPresenter do expect(presenter.autodevops_anchor_data).to eq(OpenStruct.new(enabled: false, label: 'Enable Auto DevOps', - link: presenter.project_settings_ci_cd_path(project, anchor: 'js-general-pipeline-settings'))) + link: presenter.project_settings_ci_cd_path(project, anchor: 'js-autodevops-settings'))) end end end diff --git a/spec/views/projects/settings/ci_cd/_form.html.haml_spec.rb b/spec/views/projects/settings/ci_cd/_autodevops_form.html.haml_spec.rb index be9a4d9c57c..d15391911c1 100644 --- a/spec/views/projects/settings/ci_cd/_form.html.haml_spec.rb +++ b/spec/views/projects/settings/ci_cd/_autodevops_form.html.haml_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'projects/settings/ci_cd/_form' do +describe 'projects/settings/ci_cd/_autodevops_form' do let(:project) { create(:project, :repository) } before do |