Commit c2bf084d authored by Stan Hu's avatar Stan Hu

Merge branch...

Merge branch '260339-multiple-test-failures-with-relation-feature_gates-does-not-exist' into 'master'

Resolve "Multiple test failures with `relation "feature_gates" does not exist`"

Closes #260339

See merge request gitlab-org/gitlab!44177
parents 0495af6e 07bba906
......@@ -167,7 +167,7 @@ module ApplicationSettingsHelper
end
def visible_attributes
attributes = [
[
:abuse_notification_email,
:after_sign_out_path,
:after_sign_up_text,
......@@ -265,6 +265,7 @@ module ApplicationSettingsHelper
:receive_max_input_size,
:repository_checks_enabled,
:repository_storages_weighted,
:require_admin_approval_after_user_signup,
:require_two_factor_authentication,
:restricted_visibility_levels,
:rsa_key_restriction,
......@@ -331,9 +332,6 @@ module ApplicationSettingsHelper
:wiki_page_max_content_bytes,
:container_registry_delete_tags_service_timeout
]
attributes << :require_admin_approval_after_user_signup if Feature.enabled?(:admin_approval_for_new_user_signups)
attributes
end
def external_authorization_service_attributes
......
......@@ -87,36 +87,11 @@ RSpec.describe Admin::ApplicationSettingsController do
sign_in(admin)
end
context 'require_admin_approval_after_user_signup setting' do
subject do
put :update, params: { application_setting: { require_admin_approval_after_user_signup: true } }
end
context 'when feature is enabled' do
before do
stub_feature_flags(admin_approval_for_new_user_signups: true)
end
it 'updates the require_admin_approval_after_user_signup setting' do
subject
expect(response).to redirect_to(general_admin_application_settings_path)
expect(ApplicationSetting.current.require_admin_approval_after_user_signup).to eq(true)
end
end
it 'updates the require_admin_approval_after_user_signup setting' do
put :update, params: { application_setting: { require_admin_approval_after_user_signup: true } }
context 'when feature is disabled' do
before do
stub_feature_flags(admin_approval_for_new_user_signups: false)
end
it 'does not update the require_admin_approval_after_user_signup setting' do
subject
expect(response).to redirect_to(general_admin_application_settings_path)
expect(ApplicationSetting.current.require_admin_approval_after_user_signup).not_to eq(true)
end
end
expect(response).to redirect_to(general_admin_application_settings_path)
expect(ApplicationSetting.current.require_admin_approval_after_user_signup).to eq(true)
end
it 'updates the password_authentication_enabled_for_git setting' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment