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
This commit is contained in:
parent
1364e9e4ae
commit
cd0eaa349c
4 changed files with 31 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue