From 3267e4a7851b57bef7d16da4b7c66764f63d4416 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Wed, 19 Jul 2017 00:14:43 +0900 Subject: Add unfollow modal (optional) (#4246) * Add unfollow modal * unfollowing someone * remove unnecessary prop --- spec/lib/user_settings_decorator_spec.rb | 7 +++++++ spec/models/user_spec.rb | 8 ++++++++ 2 files changed, 15 insertions(+) (limited to 'spec') diff --git a/spec/lib/user_settings_decorator_spec.rb b/spec/lib/user_settings_decorator_spec.rb index a67487779..6fbf6536b 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['default_sensitive']).to eq true end + it 'updates the user settings value for unfollow modal' do + values = { 'setting_unfollow_modal' => '0' } + + settings.update(values) + expect(user.settings['unfollow_modal']).to eq false + end + it 'updates the user settings value for boost modal' do values = { 'setting_boost_modal' => '1' } diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 2019ec0f6..ef45818b9 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -219,6 +219,14 @@ RSpec.describe User, type: :model do end end + describe '#setting_unfollow_modal' do + it 'returns unfollow modal setting' do + user = Fabricate(:user) + user.settings[:unfollow_modal] = true + expect(user.setting_unfollow_modal).to eq true + end + end + describe '#setting_delete_modal' do it 'returns delete modal setting' do user = Fabricate(:user) -- cgit