From 6dcba97c83acfde801db0d51a3911d58f8f5e45a Mon Sep 17 00:00:00 2001 From: Mark Fletcher Date: Fri, 19 Jan 2018 12:04:45 +0000 Subject: [PATCH] Permits 'password_authentication_enabled_for_git' parameter for ApplicationSettingsController --- app/helpers/application_settings_helper.rb | 1 + .../unreleased/42206-permit-password-for-git-param.yml | 5 +++++ .../admin/application_settings_controller_spec.rb | 7 +++++++ 3 files changed, 13 insertions(+) create mode 100644 changelogs/unreleased/42206-permit-password-for-git-param.yml diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index 45f7d29eb05..8ef561d90e6 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -201,6 +201,7 @@ module ApplicationSettingsHelper :metrics_sample_interval, :metrics_timeout, :password_authentication_enabled_for_web, + :password_authentication_enabled_for_git, :performance_bar_allowed_group_id, :performance_bar_enabled, :plantuml_enabled, diff --git a/changelogs/unreleased/42206-permit-password-for-git-param.yml b/changelogs/unreleased/42206-permit-password-for-git-param.yml new file mode 100644 index 00000000000..563dd528ad5 --- /dev/null +++ b/changelogs/unreleased/42206-permit-password-for-git-param.yml @@ -0,0 +1,5 @@ +--- +title: Permits 'password_authentication_enabled_for_git' parameter for ApplicationSettingsController +merge_request: +author: +type: fixed diff --git a/spec/controllers/admin/application_settings_controller_spec.rb b/spec/controllers/admin/application_settings_controller_spec.rb index 2565622f8df..cc1b1e5039e 100644 --- a/spec/controllers/admin/application_settings_controller_spec.rb +++ b/spec/controllers/admin/application_settings_controller_spec.rb @@ -51,6 +51,13 @@ describe Admin::ApplicationSettingsController do sign_in(admin) end + it 'updates the password_authentication_enabled_for_git setting' do + put :update, application_setting: { password_authentication_enabled_for_git: "0" } + + expect(response).to redirect_to(admin_application_settings_path) + expect(ApplicationSetting.current.password_authentication_enabled_for_git).to eq(false) + end + it 'updates the default_project_visibility for string value' do put :update, application_setting: { default_project_visibility: "20" }