Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2018-08-07 00:51:37 +0300
committerClement Ho <clemmakesapps@gmail.com>2018-08-07 00:51:37 +0300
commite3127132a498cd3a39a325a5c0912ca6121e2f8a (patch)
treea4ab1c6cdd871dd6f4134387bed9da4021c0ec0d /spec/features
parentd737abc537476bf2b500f550b0c733d22f338cf1 (diff)
Resolve "Improve Auto DevOps settings flow for admin and project"
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/admin/admin_settings_spec.rb2
-rw-r--r--spec/features/projects/settings/pipelines_settings_spec.rb60
2 files changed, 50 insertions, 12 deletions
diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb
index a852ca689e7..af1c153dec8 100644
--- a/spec/features/admin/admin_settings_spec.rb
+++ b/spec/features/admin/admin_settings_spec.rb
@@ -175,7 +175,7 @@ describe 'Admin updates settings' do
it 'Change CI/CD settings' do
page.within('.as-ci-cd') do
- check 'Enabled Auto DevOps for projects by default'
+ check 'Default to Auto DevOps pipeline for all projects'
fill_in 'Auto devops domain', with: 'domain.com'
click_button 'Save changes'
end
diff --git a/spec/features/projects/settings/pipelines_settings_spec.rb b/spec/features/projects/settings/pipelines_settings_spec.rb
index 742ecf82c38..30b0a5578ea 100644
--- a/spec/features/projects/settings/pipelines_settings_spec.rb
+++ b/spec/features/projects/settings/pipelines_settings_spec.rb
@@ -8,7 +8,6 @@ describe "Projects > Settings > Pipelines settings" do
before do
sign_in(user)
project.add_role(user, role)
- create(:project_auto_devops, project: project)
end
context 'for developer' do
@@ -61,19 +60,58 @@ describe "Projects > Settings > Pipelines settings" do
end
describe 'Auto DevOps' do
- it 'update auto devops settings' do
- visit project_settings_ci_cd_path(project)
+ context 'when auto devops is turned on instance-wide' do
+ before do
+ stub_application_setting(auto_devops_enabled: true)
+ end
+
+ it 'auto devops is on by default and can be manually turned off' do
+ visit project_settings_ci_cd_path(project)
- 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'
+ page.within '#autodevops-settings' do
+ expect(find_field('project_auto_devops_attributes_enabled')).to be_checked
+ expect(page).to have_content('instance enabled')
+ uncheck 'Default to Auto DevOps pipeline'
+ click_on 'Save changes'
+ end
+
+ expect(page.status_code).to eq(200)
+ expect(project.auto_devops).to be_present
+ expect(project.auto_devops).not_to be_enabled
+
+ page.within '#autodevops-settings' do
+ expect(find_field('project_auto_devops_attributes_enabled')).not_to be_checked
+ expect(page).not_to have_content('instance enabled')
+ end
end
+ end
- expect(page.status_code).to eq(200)
- expect(project.auto_devops).to be_present
- expect(project.auto_devops).not_to be_enabled
- expect(project.auto_devops.domain).to eq('test.com')
+ context 'when auto devops is not turned on instance-wide' do
+ before do
+ stub_application_setting(auto_devops_enabled: false)
+ end
+
+ it 'auto devops is off by default and can be manually turned on' do
+ visit project_settings_ci_cd_path(project)
+
+ page.within '#autodevops-settings' do
+ expect(page).not_to have_content('instance enabled')
+ expect(find_field('project_auto_devops_attributes_enabled')).not_to be_checked
+ check 'Default to Auto DevOps pipeline'
+ fill_in('project_auto_devops_attributes_domain', with: 'test.com')
+ click_on 'Save changes'
+ end
+
+ expect(page.status_code).to eq(200)
+ expect(project.auto_devops).to be_present
+ expect(project.auto_devops).to be_enabled
+ expect(project.auto_devops.domain).to eq('test.com')
+
+ page.within '#autodevops-settings' do
+ expect(find_field('project_auto_devops_attributes_enabled')).to be_checked
+ expect(page).not_to have_content('instance enabled')
+ end
+ end
end
context 'when there is a cluster with ingress and external_ip' do