diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-04-14 00:04:55 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-04-14 00:04:55 +0300 |
commit | b6c6adfa51581e933ea0693c5a3df74ef2f4b629 (patch) | |
tree | d2fee9c6067ae143c647445803d6e70e9eb3236e /spec/controllers/admin | |
parent | 6106cad9559633cf69876ef5185b361df2a30123 (diff) |
Update invalid test application_settings_controller_spec.rb
There are 2 problems with this spec:
1. It checks for default visiblity level however there is not code in
controller to handle such default. Same check can be performed on model
directly.
2. It passes empty application_setting hash while controller requires
application_setting not to be empty by using `require` with `permit`
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/controllers/admin')
-rw-r--r-- | spec/controllers/admin/application_settings_controller_spec.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/spec/controllers/admin/application_settings_controller_spec.rb b/spec/controllers/admin/application_settings_controller_spec.rb index cc1b1e5039e..b4fc2aa326f 100644 --- a/spec/controllers/admin/application_settings_controller_spec.rb +++ b/spec/controllers/admin/application_settings_controller_spec.rb @@ -72,11 +72,10 @@ describe Admin::ApplicationSettingsController do expect(ApplicationSetting.current.restricted_visibility_levels).to eq([10, 20]) end - it 'falls back to defaults when settings are omitted' do - put :update, application_setting: {} + it 'updates the restricted_visibility_levels when empty array is passed' do + put :update, application_setting: { restricted_visibility_levels: [] } expect(response).to redirect_to(admin_application_settings_path) - expect(ApplicationSetting.current.default_project_visibility).to eq(Gitlab::VisibilityLevel::PRIVATE) expect(ApplicationSetting.current.restricted_visibility_levels).to be_empty end end |