summaryrefslogtreecommitdiff
path: root/spec/helpers/users_helper_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
commit48aff82709769b098321c738f3444b9bdaa694c6 (patch)
treee00c7c43e2d9b603a5a6af576b1685e400410dee /spec/helpers/users_helper_spec.rb
parent879f5329ee916a948223f8f43d77fba4da6cd028 (diff)
downloadgitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/helpers/users_helper_spec.rb')
-rw-r--r--spec/helpers/users_helper_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/helpers/users_helper_spec.rb b/spec/helpers/users_helper_spec.rb
index 8dfdb23c64b..c9dc3fcff3f 100644
--- a/spec/helpers/users_helper_spec.rb
+++ b/spec/helpers/users_helper_spec.rb
@@ -126,6 +126,16 @@ RSpec.describe UsersHelper do
end
end
+ context 'with a pending approval user' do
+ it 'returns the pending approval badge' do
+ blocked_pending_approval_user = create(:user, :blocked_pending_approval)
+
+ badges = helper.user_badges_in_admin_section(blocked_pending_approval_user)
+
+ expect(filter_ee_badges(badges)).to eq([text: 'Pending approval', variant: 'info'])
+ end
+ end
+
context 'with an admin user' do
it "returns the admin badge" do
admin_user = create(:admin)
@@ -179,6 +189,20 @@ RSpec.describe UsersHelper do
end
end
+ describe '#can_force_email_confirmation?' do
+ subject { helper.can_force_email_confirmation?(user) }
+
+ context 'for a user that is already confirmed' do
+ it { is_expected.to eq(false) }
+ end
+
+ context 'for a user that is not confirmed' do
+ let(:user) { create(:user, :unconfirmed) }
+
+ it { is_expected.to eq(true) }
+ end
+ end
+
describe '#work_information' do
subject { helper.work_information(user) }