Browse Source

Update pending_email_change_banner_text and test descriptions

pull/2642/head
Kat 2 years ago committed by kosiakkatrina
parent
commit
bf69f2da7b
  1. 2
      app/helpers/user_helper.rb
  2. 6
      spec/helpers/user_helper_spec.rb

2
app/helpers/user_helper.rb

@ -71,7 +71,7 @@ module UserHelper
def pending_email_change_banner_text(current_user)
text = "A confirmation link has been sent to the new email address. The current email will continue to work until the change is confirmed."
text += " Deactivating this user will cancel the email change request." if current_user.support?
text += " Deactivating this user will cancel the email change request." if current_user.support? || current_user.data_coordinator?
text
end

6
spec/helpers/user_helper_spec.rb

@ -114,7 +114,7 @@ RSpec.describe UserHelper do
end
end
context "when the user doesn't has the same unconfirmed email as current email" do
context "when the user has the same unconfirmed email as current email" do
let(:user) { FactoryBot.create(:user, :data_provider, unconfirmed_email: "updated_email@example.com", email: "updated_email@example.com") }
it "does not display pending email change banner" do
@ -122,7 +122,7 @@ RSpec.describe UserHelper do
end
end
context "when the user doesn't has a different unconfirmed email" do
context "when the user has a different unconfirmed email" do
let(:user) { FactoryBot.create(:user, :data_provider, unconfirmed_email: "updated_email@example.com", email: "old_email@example.com") }
it "displays pending email change banner" do
@ -192,7 +192,7 @@ RSpec.describe UserHelper do
end
describe "pending_email_change_banner_text" do
context "with non support user" do
context "with provider user" do
let(:user) { FactoryBot.create(:user, :data_provider) }
it "returns the correct text" do

Loading…
Cancel
Save