diff options
author | Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com> | 2018-04-08 13:43:10 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-04-08 13:43:10 +0200 |
commit | cd0eaa349ca5d7e53e2ed246e70e99fc61c98370 (patch) | |
tree | 1d1f099ad6bcb3be4bd6b11343e4d915b623a286 /spec/lib | |
parent | 1364e9e4ae1fb12a1c970795f1d0afd651c7cfe2 (diff) |
Enable updating additional account information from user preferences via rest api (#6789)
* Enable updating additional account information from user preferences via rest api Resolves #6553 * Pacify rubocop * Decoerce incoming settings in UserSettingsDecorator * Create user preferences hash directly from incoming credentials instead of going through ActionController::Parameters * Clean up user preferences update * Use ActiveModel::Type::Boolean instead of manually checking stringified number equivalence
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/user_settings_decorator_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/lib/user_settings_decorator_spec.rb b/spec/lib/user_settings_decorator_spec.rb index fee875373..462c5b124 100644 --- a/spec/lib/user_settings_decorator_spec.rb +++ b/spec/lib/user_settings_decorator_spec.rb @@ -69,5 +69,16 @@ describe UserSettingsDecorator do settings.update(values) expect(user.settings['system_font_ui']).to eq false end + + it 'decoerces setting values before applying' do + values = { + 'setting_delete_modal' => 'false', + 'setting_boost_modal' => 'true', + } + + settings.update(values) + expect(user.settings['delete_modal']).to eq false + expect(user.settings['boost_modal']).to eq true + end end end |