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
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ def phone_view_data
otp_expiration: otp_expiration,
otp_delivery_preference: two_factor_authentication_method,
otp_make_default_number: selected_otp_make_default_number,
unconfirmed_phone: unconfirmed_phone?,
}.merge(generic_data)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
include ActionView::Helpers::UrlHelper

let(:view) { ActionController::Base.new.view_context }
let(:unconfirmed_phone) { false }
let(:data) do
{
confirmation_for_add_phone: false,
phone_number: '5555559876',
code_value: '999999',
otp_delivery_preference: 'sms',
totp_enabled: false,
unconfirmed_phone: unconfirmed_phone,
}
end
let(:presenter) do
Expand Down Expand Up @@ -55,6 +57,31 @@
end
end

describe '#troubleshooting_options' do
context 'when phone is unconfirmed' do
let(:unconfirmed_phone) { true }
it 'should show an option to change phone number' do
expect(presenter.troubleshooting_options).to include(
{
url: phone_setup_path,
text: t('two_factor_authentication.phone_verification.troubleshooting.change_number'),
},
)
end
end

context 'when phone is confirmed' do
it 'shpould show an option to show to mfa options list' do
expect(presenter.troubleshooting_options).to include(
{
url: login_two_factor_options_path,
text: t('two_factor_authentication.login_options_link_text'),
},
)
end
end
end

describe '#landline_warning' do
let(:landline_html) do
t(
Expand Down