Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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