-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LG-15321: relax vendor redirect in test mode #11677
Changes from all commits
9af0916
b9c13d4
8fd3671
81105b1
c21efbf
ef4c1c5
e1d5f7d
2d40398
3c57139
98c9a6e
4730e34
b8b344b
e7ef3ce
fc62995
f8066ca
d453b1d
af0673c
f0e6fbd
af1cf31
dc7e129
f41883c
9f3801f
aadaa46
4044b62
9fc1446
a6b8968
0a03187
e1f99f5
f7ffaaa
ace1915
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -293,6 +293,11 @@ | |
docv_transaction_token: @docv_transaction_token, | ||
) | ||
|
||
# Confirm that we end up on the Socure page even if we try to | ||
# go to the LN / Mock one. | ||
visit idv_document_capture_url | ||
expect(page).to have_current_path(idv_socure_document_capture_url) | ||
Comment on lines
+296
to
+299
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While this does test the redirect logic and avoids the cost of another run through the feature spec, it seems somewhat buried/hidden when included in
I guess we don't really have a test that is specific to the generic happy path? |
||
|
||
visit idv_socure_document_capture_update_path | ||
expect(DocAuthLog.find_by(user_id: @user.id).state).to be_nil | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,9 +68,9 @@ | |
visit idv_link_sent_url | ||
expect(page).to have_current_path(root_url) | ||
|
||
# Confirm that we end up on the LN / Mock page even if we try to | ||
# go to the Socure one. | ||
visit idv_hybrid_mobile_socure_document_capture_url | ||
# Confirm that we end up on the Socure page even if we try to | ||
# go to the LN / Mock one. | ||
visit idv_hybrid_mobile_document_capture_url | ||
Comment on lines
+71
to
+73
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤦 - nice catch! |
||
expect(page).to have_current_path(idv_hybrid_mobile_socure_document_capture_url) | ||
|
||
# Confirm that clicking cancel and then coming back doesn't cause errors | ||
|
@@ -459,56 +459,48 @@ | |
end | ||
|
||
context 'with a network error requesting the capture app url' do | ||
before do | ||
allow_any_instance_of(Faraday::Connection).to receive(:post) | ||
.and_raise(Faraday::ConnectionFailed) | ||
end | ||
|
||
it 'shows the network error page on the phone and the link sent page on the desktop', | ||
js: true do | ||
user = nil | ||
shared_examples 'document request API failure' do | ||
it 'shows the network error page on the phone and the link sent page on the desktop', | ||
js: true do | ||
perform_in_browser(:desktop) do | ||
visit_idp_from_sp_with_ial2(sp) | ||
sign_up_and_2fa_ial1_user | ||
|
||
perform_in_browser(:desktop) do | ||
visit_idp_from_sp_with_ial2(sp) | ||
user = sign_up_and_2fa_ial1_user | ||
complete_doc_auth_steps_before_hybrid_handoff_step | ||
clear_and_fill_in(:doc_auth_phone, phone_number) | ||
click_send_link | ||
end | ||
|
||
complete_doc_auth_steps_before_hybrid_handoff_step | ||
clear_and_fill_in(:doc_auth_phone, phone_number) | ||
click_send_link | ||
end | ||
perform_in_browser(:mobile) do | ||
visit @sms_link | ||
|
||
perform_in_browser(:mobile) do | ||
visit @sms_link | ||
expect(page).to have_text(t('doc_auth.headers.general.network_error')) | ||
expect(page).to have_text(t('doc_auth.errors.general.new_network_error')) | ||
expect(@analytics).to have_logged_event(:idv_socure_document_request_submitted) | ||
end | ||
|
||
expect(page).to have_text(t('doc_auth.headers.general.network_error')) | ||
expect(page).to have_text(t('doc_auth.errors.general.new_network_error')) | ||
expect(@analytics).to have_logged_event(:idv_socure_document_request_submitted) | ||
perform_in_browser(:desktop) do | ||
expect(page).to have_current_path(idv_link_sent_path) | ||
end | ||
end | ||
end | ||
|
||
perform_in_browser(:desktop) do | ||
expect(page).to have_current_path(idv_link_sent_path) | ||
context 'Faraday connection error' do | ||
before do | ||
allow_any_instance_of(Faraday::Connection).to receive(:post) | ||
.and_raise(Faraday::ConnectionFailed) | ||
end | ||
|
||
it_behaves_like 'document request API failure' | ||
end | ||
end | ||
|
||
context 'invalid request', allow_browser_log: true do | ||
context 'getting the capture path w wrong api key' do | ||
context 'invalid request (ie: wrong api key)', allow_browser_log: true do | ||
before do | ||
user = user_with_2fa | ||
visit_idp_from_oidc_sp_with_ial2 | ||
sign_in_and_2fa_user(user) | ||
complete_doc_auth_steps_before_document_capture_step | ||
click_idv_continue | ||
DocAuth::Mock::DocAuthMockClient.reset! | ||
stub_docv_document_request(status: 401) | ||
end | ||
|
||
it 'correctly logs event', js: true do | ||
visit idv_socure_document_capture_path | ||
expect(@analytics).to have_logged_event( | ||
:idv_socure_document_request_submitted, | ||
) | ||
end | ||
it_behaves_like 'document request API failure' | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add the test where the redirect to correct vendor is enabled, similar to the LN/mock test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spec added to this context .. thanks @solipet 👍🏿