diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-18 03:07:23 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-18 03:07:23 +0000 |
commit | 962afb3da11a72c7fca322378886b2c0be9f3385 (patch) | |
tree | 541e08c4d329ab62cfbadde45b0f15d2171e004e /spec/helpers/users_helper_spec.rb | |
parent | 8a560d56661f56804ddf6596f928e7d25db37443 (diff) | |
download | gitlab-ce-master.tar.gz |
Diffstat (limited to 'spec/helpers/users_helper_spec.rb')
-rw-r--r-- | spec/helpers/users_helper_spec.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/helpers/users_helper_spec.rb b/spec/helpers/users_helper_spec.rb index f26c37a5ff2..0a259b80219 100644 --- a/spec/helpers/users_helper_spec.rb +++ b/spec/helpers/users_helper_spec.rb @@ -561,4 +561,36 @@ RSpec.describe UsersHelper do end end end + + describe '#moderation_status', feature_category: :instance_resiliency do + let(:user) { create(:user) } + + subject { moderation_status(user) } + + context 'when user is nil' do + let(:user) { nil } + + it { is_expected.to be_nil } + end + + context 'when a user is banned' do + before do + user.ban! + end + + it { is_expected.to eq('Banned') } + end + + context 'when a user is blocked' do + before do + user.block! + end + + it { is_expected.to eq('Blocked') } + end + + context 'when a user is active' do + it { is_expected.to eq('Active') } + end + end end |