Skip to content

Commit

Permalink
LG-14998: Update add email to change email on completion screen (#11594)
Browse files Browse the repository at this point in the history
* changelog: User-Facing Improvements, Authentication with SP, change link from add email  to change email

* make url options default

* fix unnecessary spacing

* update url options

* change so all flows go to select email page

* update completions presenter spec

* update show link for a checking enabled and disabled functionality
  • Loading branch information
mdiarra3 authored Dec 17, 2024
1 parent 5dc905b commit e57b5bc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 31 deletions.
4 changes: 0 additions & 4 deletions app/presenters/completions_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ def pii
end
end

def multiple_emails?
current_user.confirmed_email_addresses.many?
end

private

def first_time_signing_in?
Expand Down
6 changes: 1 addition & 5 deletions app/views/sign_up/completions/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@
<div class="display-flex flex-justify">
<%= attribute_value.to_s %>
<p class='font-body-2xs text-right'>
<% if @presenter.multiple_emails? %>
<%= link_to t('help_text.requested_attributes.change_email_link'), sign_up_select_email_path %>
<% else %>
<%= link_to t('account.index.email_add'), add_email_path(in_select_email_flow: true) %>
<% end %>
<%= link_to t('help_text.requested_attributes.change_email_link'), sign_up_select_email_path %>
</p>
</div>
<% else %>
Expand Down
24 changes: 2 additions & 22 deletions spec/views/sign_up/completions/show.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,38 +68,18 @@
).and_return(false)
end

it 'does not show a link to select different email' do
create(:email_address, user: user)
user.reload
render

expect(rendered).to_not include(t('help_text.requested_attributes.change_email_link'))
expect(rendered).to_not include(t('account.index.email_add'))
end

it 'does not show a link to add another email' do
it 'does not show change link' do
render

expect(rendered).to_not include(t('help_text.requested_attributes.change_email_link'))
expect(rendered).to_not include(t('account.index.email_add'))
end
end

context 'select email to send to partner' do
it 'does not show a link to select different email' do
create(:email_address, user: user)
user.reload
it 'shows email change link' do
render

expect(rendered).to include(t('help_text.requested_attributes.change_email_link'))
expect(rendered).to_not include(t('account.index.email_add'))
end

it 'does not show a link to add another email' do
render

expect(rendered).to_not include(t('help_text.requested_attributes.change_email_link'))
expect(rendered).to include(t('account.index.email_add'))
end
end

Expand Down

0 comments on commit e57b5bc

Please sign in to comment.