-
Notifications
You must be signed in to change notification settings - Fork 166
FlowPolicy spec helpers for idv_session setup #9714
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
Changes from all commits
378a4a3
fca9293
c56dec1
5c0c443
3524987
5d5f7c0
e54aee0
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 |
|---|---|---|
|
|
@@ -133,7 +133,7 @@ def create_gpo_entry(pii) | |
| end | ||
|
|
||
| def phone_otp_sent? | ||
| user_phone_confirmation_session.present? | ||
| vendor_phone_confirmation && address_verification_mechanism == 'phone' | ||
|
Contributor
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. 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. |
||
| end | ||
|
|
||
| def user_phone_confirmation_session | ||
|
|
@@ -211,7 +211,7 @@ def invalidate_verify_info_step! | |
| end | ||
|
|
||
| def mark_phone_step_started! | ||
| session[:address_verification_mechanism] = :phone | ||
| session[:address_verification_mechanism] = 'phone' | ||
| session[:vendor_phone_confirmation] = true | ||
| session[:user_phone_confirmation] = false | ||
| end | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -263,7 +263,7 @@ def show | |
| end | ||
|
|
||
| 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was just bad setup. vendor_phone_confirmation is set by the phone step, user_phone_confirmation is set by the phone_confirmation step. |
||
|
|
||
| get :new | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| module FlowPolicyHelper | ||
| def stub_up_to(key, idv_session:) | ||
| keys = keys_up_to(key: key) | ||
|
|
||
| keys.each do |key| | ||
| stub_step(key: key, idv_session: idv_session) | ||
| end | ||
| end | ||
|
|
||
| def stub_step(key:, idv_session:) | ||
| case key | ||
| when :welcome | ||
| idv_session.welcome_visited = true | ||
| when :agreement | ||
| idv_session.idv_consent_given = true | ||
| when :hybrid_handoff | ||
| idv_session.flow_path = 'standard' | ||
| when :link_sent | ||
| idv_session.flow_path = 'hybrid' | ||
| idv_session.pii_from_doc = Idp::Constants::MOCK_IDV_APPLICANT.dup | ||
| when :document_capture | ||
| idv_session.pii_from_doc = Idp::Constants::MOCK_IDV_APPLICANT.dup | ||
| when :ssn | ||
| idv_session.ssn = Idp::Constants::MOCK_IDV_APPLICANT_WITH_SSN[:ssn] | ||
| when :ipp_ssn | ||
| idv_session.send(:user_session)['idv/in_person'] = { | ||
| pii_from_user: Idp::Constants::MOCK_IDV_APPLICANT_SAME_ADDRESS_AS_ID.dup, | ||
| } | ||
| idv_session.ssn = Idp::Constants::MOCK_IDV_APPLICANT_WITH_SSN[:ssn] | ||
| when :verify_info | ||
| idv_session.mark_verify_info_step_complete! | ||
| idv_session.applicant = Idp::Constants::MOCK_IDV_APPLICANT_WITH_SSN.dup | ||
| when :ipp_verify_info | ||
| idv_session.mark_verify_info_step_complete! | ||
| idv_session.applicant = Idp::Constants::MOCK_IDV_APPLICANT_WITH_SSN.dup | ||
| when :phone | ||
| idv_session.mark_phone_step_started! | ||
| when :otp_verification | ||
| idv_session.mark_phone_step_complete! | ||
| when :request_letter | ||
| idv_session.address_verification_mechanism = 'gpo' | ||
| idv_session.vendor_phone_confirmation = false | ||
| idv_session.user_phone_confirmation = false | ||
| when :enter_password | ||
| # FINAL! | ||
| end | ||
| end | ||
|
|
||
| def keys_up_to(key:) | ||
| case key | ||
| when :welcome | ||
| %i[welcome] | ||
| when :agreement | ||
| %i[welcome agreement] | ||
| when :hybrid_handoff | ||
| %i[welcome agreement hybrid_handoff] | ||
| when :link_sent | ||
| %i[welcome agreement hybrid_handoff link_sent] | ||
| when :document_capture | ||
| %i[welcome agreement hybrid_handoff document_capture] | ||
| when :ssn | ||
| %i[welcome agreement hybrid_handoff document_capture ssn] | ||
| when :ipp_ssn | ||
| %i[welcome agreement hybrid_handoff ipp_ssn] | ||
| when :verify_info | ||
| %i[welcome agreement hybrid_handoff document_capture ssn verify_info] | ||
| when :ipp_verify_info | ||
| %i[welcome agreement hybrid_handoff ipp_ssn ipp_verify_info] | ||
| when :phone | ||
| %i[welcome agreement hybrid_handoff document_capture ssn verify_info phone] | ||
| when :otp_verification | ||
| %i[welcome agreement hybrid_handoff document_capture ssn verify_info phone otp_verification] | ||
| when :request_letter | ||
| %i[welcome agreement hybrid_handoff document_capture ssn verify_info request_letter] | ||
| when :enter_password | ||
| %i[welcome agreement hybrid_handoff document_capture ssn verify_info phone otp_verification | ||
| enter_password] | ||
| else | ||
| [] | ||
| 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.
Since you don't have to submit the phone step to get to RequestLetter, for FlowPolicy purposes it follows verify_info.