-
Notifications
You must be signed in to change notification settings - Fork 166
LG-7446 Create "Cancel" Links and Supporting Cancellation Code for Identity Proofing Process (4 of 4) #7176
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
197f4f3
Add an informative comment
gangelo bae52c8
Refactors to allow SessionsController to handle IP
gangelo 8c3308c
Add a route specific to inherited proofing
gangelo 31b4a5a
Reinstate the "start over" cancellation button
gangelo cdc9e6f
Add cancel link on "Retrieving your info" view
gangelo decacc1
Add devise controller helper to get spec to pass
gangelo a9a5603
Remove unnecessary includes
gangelo 1eabce1
Refactor SessionController specs
gangelo 8e6948c
Remove unnecessary return
gangelo bf002fc
Add comments for analytics
gangelo f5a0957
Add feature specs
gangelo 50e53f1
Patch to VAIP sessions controller changes (#7269)
zachmargolis 6cc7435
Reorganize SessionsController clean up code
gangelo d9599eb
Remove skipped specs per PR feedback
gangelo 68ea3d7
Clean up sone unnecessary/redundant mocks/vars
gangelo 45d7203
Remove redundant js enable on tests
gangelo 2a12183
Make regexp to check rails paths more concise
gangelo 19ef733
Remove regex when checking current_path
gangelo ad8fe02
Remove proofing-specific tests
gangelo cc8ec24
Fix rubocop errors
gangelo 33a3425
Move tests inline
gangelo 31fee6b
Tidy up session mock
gangelo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
198 changes: 198 additions & 0 deletions
198
spec/features/idv/inherited_proofing/inherited_proofing_cancel_spec.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,198 @@ | ||
| require 'rails_helper' | ||
|
|
||
| # Simulates a user (in this case, a VA inherited proofing-authorized user) | ||
| # coming over to login.gov from a service provider, and hitting the | ||
| # OpenidConnect::AuthorizationController#index action. | ||
| def send_user_from_service_provider_to_login_gov_openid_connect(user) | ||
| expect(user).to_not be_nil | ||
| # NOTE: VA user. | ||
| visit_idp_from_oidc_va_with_ial2 | ||
| end | ||
|
|
||
| def complete_idv_steps_up_to_inherited_proofing_get_started_step(user, expect_accessible: false) | ||
| unless current_path == idv_inherited_proofing_step_path(step: :get_started) | ||
| complete_idv_steps_before_phone_step(user) | ||
| click_link t('links.cancel') | ||
| click_button t('idv.cancel.actions.start_over') | ||
| expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :get_started)) | ||
| end | ||
| expect(page).to be_axe_clean.according_to :section508, :"best-practice" if expect_accessible | ||
| end | ||
|
|
||
| def complete_idv_steps_up_to_inherited_proofing_how_verifying_step(user, expect_accessible: false) | ||
| complete_idv_steps_up_to_inherited_proofing_get_started_step user, | ||
| expect_accessible: expect_accessible | ||
| unless current_path == idv_inherited_proofing_step_path(step: :agreement) | ||
| click_on t('inherited_proofing.buttons.continue') | ||
| end | ||
| end | ||
|
|
||
| def complete_idv_steps_up_to_inherited_proofing_we_are_retrieving_step(user, | ||
| expect_accessible: false) | ||
| complete_idv_steps_up_to_inherited_proofing_how_verifying_step( | ||
| user, | ||
| expect_accessible: expect_accessible, | ||
| ) | ||
| unless current_path == idv_inherited_proofing_step_path(step: :verify_wait) | ||
| check t('inherited_proofing.instructions.consent', app_name: APP_NAME), allow_label_click: true | ||
| click_on t('inherited_proofing.buttons.continue') | ||
| end | ||
| end | ||
|
|
||
| def complete_idv_steps_up_to_inherited_proofing_verify_your_info_step(user, | ||
| expect_accessible: false) | ||
| complete_idv_steps_up_to_inherited_proofing_we_are_retrieving_step( | ||
| user, | ||
| expect_accessible: expect_accessible, | ||
| ) | ||
| end | ||
|
|
||
| feature 'inherited proofing cancel process', :js do | ||
| include InheritedProofingHelper | ||
| include_context 'va_user_context' | ||
|
|
||
| before do | ||
| allow(IdentityConfig.store).to receive(:va_inherited_proofing_mock_enabled).and_return true | ||
| send_user_from_service_provider_to_login_gov_openid_connect user | ||
| end | ||
|
|
||
| let!(:user) { user_with_2fa } | ||
|
|
||
| context 'from the "Get started verifying your identity" view, and clicking the "Cancel" link' do | ||
| before do | ||
| complete_idv_steps_up_to_inherited_proofing_get_started_step user | ||
| end | ||
|
|
||
| it 'should have current path equal to the Getting Started page' do | ||
| expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :get_started)) | ||
| end | ||
|
|
||
| context 'when clicking the "Start Over" button from the "Cancel" view' do | ||
| before do | ||
| click_link t('links.cancel') | ||
| expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :get_started)) | ||
| end | ||
|
|
||
| it 'redirects the user back to the start of the Inherited Proofing process' do | ||
| click_button t('inherited_proofing.cancel.actions.start_over') | ||
| expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :get_started)) | ||
| end | ||
| end | ||
|
|
||
| context 'when clicking the "No, keep going" button from the "Cancel" view' do | ||
| before do | ||
| click_link t('links.cancel') | ||
| expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :get_started)) | ||
| end | ||
|
|
||
| it 'redirects the user back to where the user left off in the Inherited Proofing process' do | ||
| click_button t('inherited_proofing.cancel.actions.keep_going') | ||
| expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :get_started)) | ||
| end | ||
| end | ||
|
|
||
| context 'when clicking the "Exit Login.gov" button from the "Cancel" view' do | ||
| before do | ||
| click_link t('links.cancel') | ||
| expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :get_started)) | ||
| end | ||
|
|
||
| it 'redirects the user back to the service provider website' do | ||
| click_button t('idv.cancel.actions.exit', app_name: APP_NAME) | ||
| expect(page).to have_current_path(/\/auth\/result\?/) | ||
| end | ||
| end | ||
| end | ||
|
|
||
| context 'from the "How verifying your identify works" view, and clicking the "Cancel" link' do | ||
| before do | ||
| complete_idv_steps_up_to_inherited_proofing_how_verifying_step user | ||
| end | ||
|
|
||
| it 'should have current path equal to the How Verifying (agreement step) page' do | ||
| expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :agreement)) | ||
| end | ||
|
|
||
| context 'when clicking the "Start Over" button from the "Cancel" view' do | ||
| before do | ||
| click_link t('links.cancel') | ||
| expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :agreement)) | ||
| end | ||
|
|
||
| it 'redirects the user back to the start of the Inherited Proofing process' do | ||
| click_button t('inherited_proofing.cancel.actions.start_over') | ||
| expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :get_started)) | ||
| end | ||
| end | ||
|
|
||
| context 'when clicking the "No, keep going" button from the "Cancel" view' do | ||
| before do | ||
| click_link t('links.cancel') | ||
| expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :agreement)) | ||
| end | ||
|
|
||
| it 'redirects the user back to where the user left off in the Inherited Proofing process' do | ||
| click_button t('inherited_proofing.cancel.actions.keep_going') | ||
| expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :agreement)) | ||
| end | ||
| end | ||
|
|
||
| context 'when clicking the "Exit Login.gov" button from the "Cancel" view' do | ||
| before do | ||
| click_link t('links.cancel') | ||
| expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :agreement)) | ||
| end | ||
|
|
||
| it 'redirects the user back to the service provider website' do | ||
| click_button t('idv.cancel.actions.exit', app_name: APP_NAME) | ||
| expect(page).to have_current_path(/\/auth\/result\?/) | ||
| end | ||
| end | ||
| end | ||
|
|
||
| context 'from the "Verify your information..." view, and clicking the "Cancel" link' do | ||
| before do | ||
| complete_idv_steps_up_to_inherited_proofing_verify_your_info_step user | ||
| end | ||
|
|
||
| it 'should have current path equal to the Verify your information (verify_info step) page' do | ||
| expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :verify_info)) | ||
| end | ||
|
|
||
| context 'when clicking the "Start Over" button from the "Cancel" view' do | ||
| before do | ||
| click_link t('links.cancel') | ||
| expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :verify_info)) | ||
| end | ||
|
|
||
| it 'redirects the user back to the start of the Inherited Proofing process' do | ||
| click_button t('inherited_proofing.cancel.actions.start_over') | ||
| expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :get_started)) | ||
| end | ||
| end | ||
|
|
||
| context 'when clicking the "No, keep going" button from the "Cancel" view' do | ||
| before do | ||
| click_link t('links.cancel') | ||
| expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :verify_info)) | ||
| end | ||
|
|
||
| it 'redirects the user back to where the user left off in the Inherited Proofing process' do | ||
| click_button t('inherited_proofing.cancel.actions.keep_going') | ||
| expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :verify_info)) | ||
| end | ||
| end | ||
|
|
||
| context 'when clicking the "Exit Login.gov" button from the "Cancel" view' do | ||
| before do | ||
| click_link t('links.cancel') | ||
| expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :verify_info)) | ||
| end | ||
|
|
||
| it 'redirects the user back to the service provider website' do | ||
| click_button t('idv.cancel.actions.exit', app_name: APP_NAME) | ||
| expect(page).to have_current_path(/\/auth\/result\?/) | ||
| end | ||
| end | ||
| end | ||
| end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.