diff options
Diffstat (limited to 'spec/controllers/admin/application_settings_controller_spec.rb')
-rw-r--r-- | spec/controllers/admin/application_settings_controller_spec.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/spec/controllers/admin/application_settings_controller_spec.rb b/spec/controllers/admin/application_settings_controller_spec.rb index fe28e791ade..8ab29a72477 100644 --- a/spec/controllers/admin/application_settings_controller_spec.rb +++ b/spec/controllers/admin/application_settings_controller_spec.rb @@ -2,8 +2,9 @@ require 'spec_helper' -describe Admin::ApplicationSettingsController do +RSpec.describe Admin::ApplicationSettingsController do include StubENV + include UsageDataHelpers let(:group) { create(:group) } let(:project) { create(:project, namespace: group) } @@ -16,7 +17,7 @@ describe Admin::ApplicationSettingsController do describe 'GET #usage_data with no access' do before do - allow(ActiveRecord::Base.connection).to receive(:transaction_open?).and_return(false) + stub_usage_data_connections sign_in(user) end @@ -29,7 +30,7 @@ describe Admin::ApplicationSettingsController do describe 'GET #usage_data' do before do - allow(ActiveRecord::Base.connection).to receive(:transaction_open?).and_return(false) + stub_usage_data_connections sign_in(admin) end @@ -120,6 +121,13 @@ describe Admin::ApplicationSettingsController do expect(ApplicationSetting.current.namespace_storage_size_limit).not_to eq(-100) end + it 'updates repository_storages_weighted setting' do + put :update, params: { application_setting: { repository_storages_weighted_default: 75 } } + + expect(response).to redirect_to(general_admin_application_settings_path) + expect(ApplicationSetting.current.repository_storages_weighted_default).to eq(75) + end + context 'external policy classification settings' do let(:settings) do { |