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
9 changes: 5 additions & 4 deletions app/controllers/concerns/idv/step_indicator_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ def in_person_proofing?
end

def gpo_address_verification?
# Proofing component values are (currently) never reset between proofing attempts, hence why
# this refers to the session address verification mechanism and not the proofing component.
return true if current_user&.gpo_verification_pending_profile?
# This can be used in a context where user_session and idv_session are not available
# (hybrid flow), so check for current_user before accessing them.
return false unless current_user
return true if current_user.gpo_verification_pending_profile?

return idv_session&.address_verification_mechanism == 'gpo' if defined?(idv_session)
return idv_session.address_verification_mechanism == 'gpo'
end
end
end
1 change: 1 addition & 0 deletions app/controllers/idv/session_errors_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def warning
rate_limit_type: :idv_resolution,
)

@step_indicator_steps = step_indicator_steps
@remaining_attempts = rate_limiter.remaining_count
log_event(based_on_limiter: rate_limiter)
end
Expand Down
1 change: 0 additions & 1 deletion app/views/idv/session_errors/failure.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
'idv/shared/error',
title: t('titles.failure.information_not_verified'),
heading: t('idv.failure.sessions.heading'),
current_step: :verify_info,
options: [
{
url: MarketingSite.contact_url,
Expand Down
9 changes: 9 additions & 0 deletions app/views/idv/session_errors/warning.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<% title t('titles.failure.information_not_verified') %>

<% content_for(:pre_flash_content) do %>
<%= render StepIndicatorComponent.new(
steps: @step_indicator_steps,
current_step: :verify_info,
locale_scope: 'idv',
class: 'margin-x-neg-2 margin-top-neg-4 tablet:margin-x-neg-6 tablet:margin-top-neg-4',
) %>
<% end %>

<%= render StatusPageComponent.new(status: :warning) do |c| %>
<% c.with_header { t('idv.warning.sessions.heading') } %>

Expand Down
56 changes: 14 additions & 42 deletions spec/controllers/idv/session_errors_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,20 @@
get action
end
end

context 'the user is in the hybrid flow' do
render_views
let(:effective_user) { create(:user) }

before do
session[:doc_capture_user_id] = effective_user.id
end

it 'renders the error template' do
get action
expect(response).to render_template(template)
end
end
end

let(:verify_info_step_complete) { false }
Expand Down Expand Up @@ -134,20 +148,6 @@

it_behaves_like 'an idv session errors controller action'
it_behaves_like 'non-authenticated idv session errors controller action'

context 'the user is in the hybrid flow' do
render_views
let(:effective_user) { create(:user) }

before do
session[:doc_capture_user_id] = effective_user.id
end

it 'renders the error template' do
get action
expect(response).to render_template(template)
end
end
end

describe '#warning' do
Expand All @@ -160,20 +160,6 @@
it_behaves_like 'an idv session errors controller action'
it_behaves_like 'non-authenticated idv session errors controller action'

context 'the user is in the hybrid flow' do
render_views
let(:effective_user) { create(:user) }

before do
session[:doc_capture_user_id] = effective_user.id
end

it 'renders the error template' do
get action
expect(response).to render_template(template)
end
end

context 'with rate limit attempts' do
let(:user) { create(:user) }

Expand Down Expand Up @@ -334,20 +320,6 @@
it_behaves_like 'an idv session errors controller action'
it_behaves_like 'non-authenticated idv session errors controller action'

context 'the user is in the hybrid flow' do
render_views
let(:effective_user) { create(:user) }

before do
session[:doc_capture_user_id] = effective_user.id
end

it 'renders the error template' do
get action
expect(response).to render_template(template)
end
end

context 'while rate limited' do
let(:user) { create(:user) }

Expand Down
2 changes: 2 additions & 0 deletions spec/features/idv/doc_auth/verify_info_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
click_idv_continue

expect(page).to have_current_path(idv_session_errors_warning_path)
expect_step_indicator_current_step(t('step_indicator.flows.idv.verify_info'))
click_on t('idv.failure.button.warning')

expect(page).to have_current_path(idv_verify_info_path)
Expand Down Expand Up @@ -173,6 +174,7 @@

click_idv_continue
expect(page).to have_current_path(idv_session_errors_failure_path)
expect(page).not_to have_css('.step-indicator__step--current', text: text, wait: 5)
expect(fake_analytics).to have_logged_event(
'Rate Limit Reached',
limiter_type: :idv_resolution,
Expand Down
2 changes: 2 additions & 0 deletions spec/views/idv/session_errors/warning.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
assign(:remaining_attempts, remaining_attempts)
assign(:try_again_path, try_again_path)

@step_indicator_steps = Idv::StepIndicatorConcern::STEP_INDICATOR_STEPS

render
end

Expand Down