Skip to content
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

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

amirbey
Copy link
Contributor

@amirbey amirbey commented Dec 19, 2024

🎫 Ticket

LG-15321

🛠 Summary of changes

Use a flag to disable redirect_to_correct_vendor filter.

📜 Testing Plan

When redirect_to_correct_vendor is enforced

  1. Set doc_auth_redirect_to_correct_vendor_disabled to false in application.yml
  2. While on Socure document capture page, visit Mock/LN document capture page and verify Socure document capture page is displayed
  3. While on Socure hybrid document capture page, visit Mock/LN hybrid document capture page and verify Socure hybrid document capture page is displayed
  4. While on Mock/LN document capture page, visit Socure document capture page and verify Mock/LN document capture page is displayed
  5. While on Mock/LN hybrid document capture page, visit Socure hybrid document capture page and verify Mock/LN hybrid document capture page is displayed

When redirect_to_correct_vendor is relaxed

  1. Set doc_auth_redirect_to_correct_vendor_disabled to true in application.yml
  2. While on Socure document capture page, visit Mock/LN document capture page and verify Mock/LN document capture page is displayed
  3. While on Socure hybrid document capture page, visit Mock/LN hybrid document capture page and verify Mock/LN hybrid document capture page is displayed
  4. While on Mock/LN document capture page, visit Socure document capture page and verify Socure document capture page is displayed
  5. While on Mock/LN hybrid document capture page, visit Socure hybrid document capture page and verify Socure hybrid document capture page is displayed

@amirbey amirbey self-assigned this Dec 19, 2024
@amirbey amirbey force-pushed the amirbey/LG-15321-relax-vendor-redirect-in-test-mode branch from 25e5476 to 66cdf8c Compare January 2, 2025 19:45
@amirbey amirbey marked this pull request as ready for review January 3, 2025 20:17
@amirbey amirbey requested review from jmax-gsa and solipet January 3, 2025 20:17
Copy link
Contributor

@solipet solipet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments on the specs, but in testing, the flag works as expected.

Note the Testing Plan tests the behavior if the redirect is NOT disabled. Approving per the AC in the Jira ticket.

.to receive(:doc_auth_redirect_to_correct_vendor_disabled).and_return(true)
end

it 'redirects to the Socure controller' do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
it 'redirects to the Socure controller' do
it 'allows the user to use this controller' do

@@ -211,6 +211,23 @@
expect(document_capture_session.socure_docv_transaction_token)
.to eq(docv_transaction_token)
end

context 'when we try to use this controller but we should be using the LN/mock version' do
Copy link
Contributor

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?

Copy link
Contributor Author

@amirbey amirbey Jan 10, 2025

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 👍🏿

Comment on lines +296 to +299
# 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)
Copy link
Contributor

Choose a reason for hiding this comment

The 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

  it 'does not track state if state tracking is disabled' do
    ...

I guess we don't really have a test that is specific to the generic happy path?

Comment on lines +71 to +73
# 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 - nice catch!

@amirbey
Copy link
Contributor Author

amirbey commented Jan 10, 2025

A few comments on the specs, but in testing, the flag works as expected.

Note the Testing Plan tests the behavior if the redirect is NOT disabled. Approving per the AC in the Jira ticket.

The testing plan has been updated ... thanks @solipet 🙏🏿

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants