summaryrefslogtreecommitdiff
path: root/spec/controllers/profiles/preferences_controller_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-04-25 03:09:02 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-04-25 03:09:02 +0000
commit26891eec2cea8ca5e75a96a50d8785da6042cc5a (patch)
treeb732a7a69a0a4cf44afa24bf9d6eddfa5c3805fd /spec/controllers/profiles/preferences_controller_spec.rb
parent15e5a05bcd3525dd6c046dca2682b04532ba9bd1 (diff)
downloadgitlab-ce-26891eec2cea8ca5e75a96a50d8785da6042cc5a.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/profiles/preferences_controller_spec.rb')
-rw-r--r--spec/controllers/profiles/preferences_controller_spec.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/controllers/profiles/preferences_controller_spec.rb b/spec/controllers/profiles/preferences_controller_spec.rb
index e2a216bb462..0554ab3184f 100644
--- a/spec/controllers/profiles/preferences_controller_spec.rb
+++ b/spec/controllers/profiles/preferences_controller_spec.rb
@@ -109,5 +109,33 @@ RSpec.describe Profiles::PreferencesController do
expect(response.parsed_body['type']).to eq('alert')
end
end
+
+ context 'on disable_follow_users feature flag' do
+ context 'with feature flag disabled' do
+ before do
+ stub_feature_flags(disable_follow_users: false)
+ end
+
+ it 'does not update enabled_following preference of user' do
+ prefs = { enabled_following: false }
+
+ go params: prefs
+ user.reload
+
+ expect(user.enabled_following).to eq(true)
+ end
+ end
+
+ context 'with feature flag enabled' do
+ it 'does not update enabled_following preference of user' do
+ prefs = { enabled_following: false }
+
+ go params: prefs
+ user.reload
+
+ expect(user.enabled_following).to eq(false)
+ end
+ end
+ end
end
end