diff options
Diffstat (limited to 'spec/helpers/users_helper_spec.rb')
-rw-r--r-- | spec/helpers/users_helper_spec.rb | 24 |
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) } |