Commit c8c03f1d authored by Mike Greiling's avatar Mike Greiling

Merge branch '49814-display-in-admin-area-if-emails-are-verified-or-not' into 'master'

Resolve "Display in admin area if emails are verified or not"

Closes #49814

See merge request gitlab-org/gitlab-ce!29669
parents 82f5d90e aebf867a
......@@ -32,11 +32,12 @@
%li
%span.light Email:
%strong
= mail_to @user.email
= render partial: 'shared/email_with_badge', locals: { email: mail_to(@user.email), verified: @user.confirmed? }
- @user.emails.each do |email|
%li
%span.light Secondary email:
%strong= email.email
%strong
= render partial: 'shared/email_with_badge', locals: { email: email.email, verified: email.confirmed? }
= link_to remove_email_admin_user_path(@user, email), data: { confirm: "Are you sure you want to remove #{email.email}?" }, method: :delete, class: "btn-sm btn btn-remove float-right", title: 'Remove secondary email', id: "remove_email_#{email.id}" do
%i.fa.fa-times
%li
......
---
title: Add a verified pill next to email addresses under the admin users section.
merge_request: 29669
author:
type: added
......@@ -419,6 +419,32 @@ describe "Admin::Users" do
end
end
end
describe 'Email verification status' do
let!(:secondary_email) do
create :email, email: 'secondary@example.com', user: user
end
it 'displays the correct status for an unverified email address' do
user.update(confirmed_at: nil, unconfirmed_email: user.email)
visit admin_user_path(user)
expect(page).to have_content("#{user.email} Unverified")
expect(page).to have_content("#{secondary_email.email} Unverified")
end
it 'displays the correct status for a verified email address' do
visit admin_user_path(user)
expect(page).to have_content("#{user.email} Verified")
secondary_email.confirm
expect(secondary_email.confirmed?).to be_truthy
visit admin_user_path(user)
expect(page).to have_content("#{secondary_email.email} Verified")
end
end
end
describe "GET /admin/users/:id/edit" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment