diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/settings/preferences_controller_spec.rb | 3 | ||||
-rw-r--r-- | spec/lib/user_settings_decorator_spec.rb | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/spec/controllers/settings/preferences_controller_spec.rb b/spec/controllers/settings/preferences_controller_spec.rb index 38e43f211..60fa42302 100644 --- a/spec/controllers/settings/preferences_controller_spec.rb +++ b/spec/controllers/settings/preferences_controller_spec.rb @@ -28,12 +28,14 @@ describe Settings::PreferencesController do it 'updates user settings' do user.settings['boost_modal'] = false + user.settings['delete_modal'] = true user.settings['notification_emails'] = user.settings['notification_emails'].merge('follow' => false) user.settings['interactions'] = user.settings['interactions'].merge('must_be_follower' => true) put :update, params: { user: { setting_boost_modal: '1', + setting_delete_modal: '0', notification_emails: { follow: '1' }, interactions: { must_be_follower: '0' }, } @@ -42,6 +44,7 @@ describe Settings::PreferencesController do expect(response).to redirect_to(settings_preferences_path) user.reload expect(user.settings['boost_modal']).to be true + expect(user.settings['delete_modal']).to be false expect(user.settings['notification_emails']['follow']).to be true expect(user.settings['interactions']['must_be_follower']).to be false end diff --git a/spec/lib/user_settings_decorator_spec.rb b/spec/lib/user_settings_decorator_spec.rb index 466c57fa5..66e42fa0e 100644 --- a/spec/lib/user_settings_decorator_spec.rb +++ b/spec/lib/user_settings_decorator_spec.rb @@ -35,6 +35,13 @@ describe UserSettingsDecorator do expect(user.settings['boost_modal']).to eq true end + it 'updates the user settings value for delete toot modal' do + values = { 'setting_delete_modal' => '0' } + + settings.update(values) + expect(user.settings['delete_modal']).to eq false + end + it 'updates the user settings value for gif auto play' do values = { 'setting_auto_play_gif' => '0' } |