summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/views/projects/pipelines_settings/_show.html.haml4
-rw-r--r--spec/controllers/projects/pipelines_settings_controller_spec.rb (renamed from spec/controllers/projects/pipelines_setttings_controller_spec.rb)14
2 files changed, 15 insertions, 3 deletions
diff --git a/app/views/projects/pipelines_settings/_show.html.haml b/app/views/projects/pipelines_settings/_show.html.haml
index 324cd423ede..2aceb4b529c 100644
--- a/app/views/projects/pipelines_settings/_show.html.haml
+++ b/app/views/projects/pipelines_settings/_show.html.haml
@@ -25,8 +25,8 @@
%span.descr
A specific .gitlab-ci.yml file needs to be specified before you can begin using Continious Integration and Delivery.
.radio
- = form.label :enabled do
- = form.radio_button :enabled, nil
+ = form.label :enabled_nil do
+ = form.radio_button :enabled, ''
%strong
Instance default (status: #{current_application_settings.auto_devops_enabled?})
%br
diff --git a/spec/controllers/projects/pipelines_setttings_controller_spec.rb b/spec/controllers/projects/pipelines_settings_controller_spec.rb
index 9eb6d7ce8b5..ee46ad00947 100644
--- a/spec/controllers/projects/pipelines_setttings_controller_spec.rb
+++ b/spec/controllers/projects/pipelines_settings_controller_spec.rb
@@ -17,15 +17,27 @@ describe Projects::PipelinesSettingsController do
namespace_id: project.namespace.to_param,
project_id: project,
project: {
- auto_devops_attributes: { enabled: false, domain: 'mempmep.md' }
+ auto_devops_attributes: params
}
end
context 'when updating the auto_devops settings' do
+ let(:params) { { enabled: '', domain: 'mepmep.md' } }
+
it 'redirects to the settings page' do
expect(response).to have_http_status(302)
expect(flash[:notice]).to eq("Pipelines settings for '#{project.name}' were successfully updated.")
end
+
+ context 'following the instance default' do
+ let(:params) { { enabled: '' } }
+
+ it 'allows enabled to be set to nil' do
+ project_auto_devops.reload
+
+ expect(project_auto_devops.enabled).to be_nil
+ end
+ end
end
end
end