FlowPolicy spec helpers for idv_session setup#9714
Merged
soniaconnolly merged 7 commits intomainfrom Dec 6, 2023
Merged
Conversation
Added :enter_password as a next step for :phone step_info for verify_by_mail
| key: :verify_info, | ||
| controller: self, | ||
| next_steps: [:phone], | ||
| next_steps: [:phone, :request_letter], |
Contributor
There was a problem hiding this comment.
Since you don't have to submit the phone step to get to RequestLetter, for FlowPolicy purposes it follows verify_info.
|
|
||
| def phone_otp_sent? | ||
| user_phone_confirmation_session.present? | ||
| vendor_phone_confirmation && address_verification_mechanism == 'phone' |
Contributor
There was a problem hiding this comment.
Changed to use the vendor_phone_confirmation flag, which is always set at the same time that the user_phone_confirmation_session is created. This is a lot easier to manage in specs. And check the address_verification_mechanism to differentiate the phone step from the verify by mail flow.
|
|
||
| it 'redirects to phone step if the user has not completed it' do | ||
| subject.idv_session.user_phone_confirmation = nil | ||
| subject.idv_session.vendor_phone_confirmation = nil |
Contributor
There was a problem hiding this comment.
This was just bad setup. vendor_phone_confirmation is set by the phone step, user_phone_confirmation is set by the phone_confirmation step.
matthinz
reviewed
Dec 6, 2023
| context 'preconditions for agreement are present' do | ||
| it 'returns agreement' do | ||
| idv_session.welcome_visited = true | ||
| stub_up_to_key(key: :welcome, idv_session: idv_session) |
Contributor
There was a problem hiding this comment.
I think this would read a little smoother:
Suggested change
| stub_up_to_key(key: :welcome, idv_session: idv_session) | |
| stub_up_to(:welcome, idv_session: idv_session) |
Co-authored-by: Matt Hinz <matt.hinz@gsa.gov>
matthinz
approved these changes
Dec 6, 2023
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🛠 Summary of changes
Introduces helpers in FlowPolicyHelper to set up the preconditions for idv steps in our specs. Note how much cleaner the flow_policy_spec setup is for all the individual step specs. We plan to use
stub_up_to_keyin the controller specs once this is merged.Along the way, improved preconditions for PhoneStep and VerifyByMail.
📜 Testing Plan
/verify/phone,/verify/phone_confirmation,/verify/by_mail/request_letter,/verify/enter_password,/verify/personal_key/verify/phone_confirmation,/verify/enter_password,/verify/personal_key/verify/enter_password,/verify/personal_key