diff --git a/app/controllers/concerns/idv/verify_info_concern.rb b/app/controllers/concerns/idv/verify_info_concern.rb index 3560c6c4224..e23072e30b2 100644 --- a/app/controllers/concerns/idv/verify_info_concern.rb +++ b/app/controllers/concerns/idv/verify_info_concern.rb @@ -34,7 +34,7 @@ def shared_update user_id: current_user.id, threatmetrix_session_id: idv_session.threatmetrix_session_id, request_ip: request.remote_ip, - double_address_verification: capture_secondary_id_enabled, + double_address_verification: double_address_verification, ) return true @@ -42,9 +42,11 @@ def shared_update private - def capture_secondary_id_enabled - current_user.establishing_in_person_enrollment&. - capture_secondary_id_enabled || false + def double_address_verification + # If in person return true else return false. This is temporary until we add a feature flag + # to track enrollment was created in the in person flow. + # todo LG-11235 update value based on new feature flag + current_user.has_in_person_enrollment? end def should_use_aamva?(pii) diff --git a/app/controllers/idv/in_person/verify_info_controller.rb b/app/controllers/idv/in_person/verify_info_controller.rb index 6ce2fc38a91..473aeaff6ac 100644 --- a/app/controllers/idv/in_person/verify_info_controller.rb +++ b/app/controllers/idv/in_person/verify_info_controller.rb @@ -13,7 +13,6 @@ class VerifyInfoController < ApplicationController def show @step_indicator_steps = step_indicator_steps @ssn = idv_session.ssn - @capture_secondary_id_enabled = capture_secondary_id_enabled analytics.idv_doc_auth_verify_visited(**analytics_arguments) Funnel::DocAuth::RegisterStep.new(current_user.id, sp_session[:issuer]). diff --git a/app/forms/idv/in_person/address_form.rb b/app/forms/idv/in_person/address_form.rb index 43d5b422cca..6bfd7493462 100644 --- a/app/forms/idv/in_person/address_form.rb +++ b/app/forms/idv/in_person/address_form.rb @@ -8,10 +8,6 @@ class AddressForm attr_accessor(*ATTRIBUTES) - def initialize(capture_secondary_id_enabled:) - @capture_secondary_id_enabled = capture_secondary_id_enabled - end - def self.model_name ActiveModel::Name.new(self, nil, 'InPersonAddress') end @@ -33,9 +29,6 @@ def submit(params) private - attr_reader :capture_secondary_id_enabled - alias_method :capture_secondary_id_enabled?, :capture_secondary_id_enabled - def consume_params(params) params.each do |key, value| raise_invalid_address_parameter_error(key) unless ATTRIBUTES.include?(key.to_sym) diff --git a/app/forms/idv/state_id_form.rb b/app/forms/idv/state_id_form.rb index 3f80e517ca3..2225225344a 100644 --- a/app/forms/idv/state_id_form.rb +++ b/app/forms/idv/state_id_form.rb @@ -13,9 +13,8 @@ def self.model_name ActiveModel::Name.new(self, nil, 'StateId') end - def initialize(pii, capture_secondary_id_enabled:) + def initialize(pii) @pii = pii - @capture_secondary_id_enabled = capture_secondary_id_enabled end def submit(params) @@ -36,9 +35,6 @@ def submit(params) private - attr_reader :capture_secondary_id_enabled - alias_method :capture_secondary_id_enabled?, :capture_secondary_id_enabled - def consume_params(params) params.each do |key, value| raise_invalid_state_id_parameter_error(key) unless ATTRIBUTES.include?(key.to_sym) diff --git a/app/jobs/get_usps_proofing_results_job.rb b/app/jobs/get_usps_proofing_results_job.rb index 3690d77acdc..0368a69232a 100644 --- a/app/jobs/get_usps_proofing_results_job.rb +++ b/app/jobs/get_usps_proofing_results_job.rb @@ -120,9 +120,8 @@ def check_enrollment(enrollment) enrollment.update(status_check_attempted_at: status_check_attempted_at) end - def passed_with_unsupported_secondary_id_type?(enrollment, response) - return enrollment.capture_secondary_id_enabled && - response['secondaryIdType'].present? && + def passed_with_unsupported_secondary_id_type?(response) + return response['secondaryIdType'].present? && SUPPORTED_SECONDARY_ID_TYPES.exclude?(response['secondaryIdType']) end @@ -414,7 +413,7 @@ def process_enrollment_response(enrollment, response) case response['status'] when IPP_STATUS_PASSED - if passed_with_unsupported_secondary_id_type?(enrollment, response) + if passed_with_unsupported_secondary_id_type?(response) handle_unsupported_secondary_id(enrollment, response) elsif SUPPORTED_ID_TYPES.include?(response['primaryIdType']) handle_successful_status_update(enrollment, response) diff --git a/app/models/in_person_enrollment.rb b/app/models/in_person_enrollment.rb index 169b2f16779..313a133d6fa 100644 --- a/app/models/in_person_enrollment.rb +++ b/app/models/in_person_enrollment.rb @@ -32,7 +32,6 @@ class InPersonEnrollment < ApplicationRecord before_save(:on_status_updated, if: :will_save_change_to_status?) before_save(:on_notification_sent_at_updated, if: :will_save_change_to_notification_sent_at?) before_create(:set_unique_id, unless: :unique_id) - before_create(:set_capture_secondary_id) class << self def needs_early_email_reminder(early_benchmark, late_benchmark) @@ -182,10 +181,4 @@ def profile_belongs_to_user type: :in_person_enrollment_user_profile_mismatch end end - - def set_capture_secondary_id - if IdentityConfig.store.in_person_capture_secondary_id_enabled - self.capture_secondary_id_enabled = true - end - end end diff --git a/app/presenters/idv/in_person/ready_to_verify_presenter.rb b/app/presenters/idv/in_person/ready_to_verify_presenter.rb index f52a5184137..3398cb572c9 100644 --- a/app/presenters/idv/in_person/ready_to_verify_presenter.rb +++ b/app/presenters/idv/in_person/ready_to_verify_presenter.rb @@ -30,10 +30,6 @@ def selected_location_hours(prefix) return localized_hours(hours) if hours end - def needs_proof_of_address? - !(enrollment.current_address_matches_id || enrollment.capture_secondary_id_enabled) - end - def service_provider enrollment.service_provider end diff --git a/app/presenters/idv/in_person/verification_results_email_presenter.rb b/app/presenters/idv/in_person/verification_results_email_presenter.rb index c89838e07c7..98523931bbf 100644 --- a/app/presenters/idv/in_person/verification_results_email_presenter.rb +++ b/app/presenters/idv/in_person/verification_results_email_presenter.rb @@ -47,10 +47,6 @@ def service_provider_homepage_url sp_return_url_resolver.homepage_url if service_provider end - def needs_proof_of_address? - !(enrollment.current_address_matches_id || enrollment.capture_secondary_id_enabled) - end - private def sp_return_url_resolver diff --git a/app/services/idv/steps/doc_auth_base_step.rb b/app/services/idv/steps/doc_auth_base_step.rb index 593bb51d77a..64679881331 100644 --- a/app/services/idv/steps/doc_auth_base_step.rb +++ b/app/services/idv/steps/doc_auth_base_step.rb @@ -7,10 +7,6 @@ def initialize(flow) private - def capture_secondary_id_enabled? - current_user.establishing_in_person_enrollment.capture_secondary_id_enabled - end - def save_proofing_components return unless current_user diff --git a/app/services/idv/steps/in_person/address_step.rb b/app/services/idv/steps/in_person/address_step.rb index 7b53f4943f7..7a28e11137b 100644 --- a/app/services/idv/steps/in_person/address_step.rb +++ b/app/services/idv/steps/in_person/address_step.rb @@ -9,20 +9,14 @@ def self.analytics_visited_event end def analytics_submitted_event - if capture_secondary_id_enabled? - :idv_in_person_proofing_residential_address_submitted - else - :idv_in_person_proofing_address_submitted - end + :idv_in_person_proofing_residential_address_submitted end def call attrs = Idv::InPerson::AddressForm::ATTRIBUTES - if capture_secondary_id_enabled? - attrs = attrs.difference([:same_address_as_id]) - flow_session[:pii_from_user][:same_address_as_id] = 'false' if updating_address? - end + attrs = attrs.difference([:same_address_as_id]) + flow_session[:pii_from_user][:same_address_as_id] = 'false' if updating_address? attrs.each do |attr| flow_session[:pii_from_user][attr] = flow_params[attr] @@ -35,7 +29,6 @@ def call def extra_view_variables { - capture_secondary_id_enabled: capture_secondary_id_enabled?, form:, pii:, updating_address: updating_address?, @@ -61,8 +54,7 @@ def flow_params end def form - @form ||= Idv::InPerson::AddressForm. - new(capture_secondary_id_enabled: capture_secondary_id_enabled?) + @form ||= Idv::InPerson::AddressForm.new end def form_submit diff --git a/app/services/idv/steps/in_person/state_id_step.rb b/app/services/idv/steps/in_person/state_id_step.rb index 872387abe32..c3079c55468 100644 --- a/app/services/idv/steps/in_person/state_id_step.rb +++ b/app/services/idv/steps/in_person/state_id_step.rb @@ -23,20 +23,18 @@ def call formatted_dob = MemorableDateComponent.extract_date_param flow_params&.[](:dob) pii_from_user[:dob] = formatted_dob if formatted_dob - if capture_secondary_id_enabled? - if pii_from_user[:same_address_as_id] == 'true' - copy_state_id_address_to_residential_address(pii_from_user) - mark_step_complete(:address) - redirect_to idv_in_person_ssn_url - end - - if initial_state_of_same_address_as_id == 'true' && - pii_from_user[:same_address_as_id] == 'false' - clear_residential_address(pii_from_user) - mark_step_incomplete(:address) - end + if pii_from_user[:same_address_as_id] == 'true' + copy_state_id_address_to_residential_address(pii_from_user) + mark_step_complete(:address) + redirect_to idv_in_person_ssn_url end + if initial_state_of_same_address_as_id == 'true' && + pii_from_user[:same_address_as_id] == 'false' + clear_residential_address(pii_from_user) + mark_step_incomplete(:address) + end + if flow_session['Idv::Steps::InPerson::AddressStep'] redirect_to idv_in_person_verify_info_url end @@ -44,7 +42,6 @@ def call def extra_view_variables { - capture_secondary_id_enabled: capture_secondary_id_enabled?, form:, pii:, parsed_dob:, @@ -104,10 +101,7 @@ def flow_params end def form - @form ||= Idv::StateIdForm.new( - current_user, - capture_secondary_id_enabled: capture_secondary_id_enabled?, - ) + @form ||= Idv::StateIdForm.new(current_user) end def form_submit diff --git a/app/services/usps_in_person_proofing/enrollment_helper.rb b/app/services/usps_in_person_proofing/enrollment_helper.rb index b116838f56d..f2ef64237ec 100644 --- a/app/services/usps_in_person_proofing/enrollment_helper.rb +++ b/app/services/usps_in_person_proofing/enrollment_helper.rb @@ -8,10 +8,9 @@ def schedule_in_person_enrollment(user, pii) enrollment.current_address_matches_id = pii['same_address_as_id'] enrollment.save! - # If we're using secondary ID capture (aka double address verification), - # then send the state ID address to USPS. Otherwise send the residential address. + # Send state ID address to USPS pii = pii.to_h - if enrollment.capture_secondary_id_enabled? && !enrollment.current_address_matches_id? + if !enrollment.current_address_matches_id? pii = pii.except(*SECONDARY_ID_ADDRESS_MAP.values). transform_keys(SECONDARY_ID_ADDRESS_MAP) end diff --git a/app/validators/idv/form_state_id_validator.rb b/app/validators/idv/form_state_id_validator.rb index cb993bae471..62dbe02e3e1 100644 --- a/app/validators/idv/form_state_id_validator.rb +++ b/app/validators/idv/form_state_id_validator.rb @@ -7,15 +7,12 @@ module FormStateIdValidator validates :first_name, :last_name, :dob, + :identity_doc_address1, + :identity_doc_city, :state_id_jurisdiction, :state_id_number, presence: true - validates :identity_doc_address1, - :identity_doc_city, - presence: true, - if: :capture_secondary_id_enabled? - validates_with UspsInPersonProofing::TransliterableValidator, fields: [:first_name, :last_name, :identity_doc_city], reject_chars: /[^A-Za-z\-' ]/, diff --git a/app/validators/idv/in_person/form_address_validator.rb b/app/validators/idv/in_person/form_address_validator.rb index 928b377caff..00a44ca4d36 100644 --- a/app/validators/idv/in_person/form_address_validator.rb +++ b/app/validators/idv/in_person/form_address_validator.rb @@ -5,10 +5,6 @@ module FormAddressValidator include Idv::FormAddressValidator included do - validates :same_address_as_id, - presence: true, - unless: :capture_secondary_id_enabled? - validates_with UspsInPersonProofing::TransliterableValidator, fields: [:city], reject_chars: /[^A-Za-z\-' ]/, diff --git a/app/views/idv/in_person/address.html.erb b/app/views/idv/in_person/address.html.erb index f2b02c809a8..bf5a5799ff0 100644 --- a/app/views/idv/in_person/address.html.erb +++ b/app/views/idv/in_person/address.html.erb @@ -6,36 +6,21 @@ <%= render PageHeadingComponent.new.with_content(t('in_person_proofing.headings.address')) %> <% end %> -<% unless capture_secondary_id_enabled %> -

- <%= t('in_person_proofing.body.address.info') %> - <%= new_tab_link_to( - t('in_person_proofing.body.address.learn_more'), - MarketingSite.help_center_article_url( - category: 'verify-your-identity', - article: 'verify-your-identity-in-person', - ), - ) %> -

-<% end %> - <%= simple_form_for( form, url: url_for, method: 'PUT', html: { autocomplete: 'off' } ) do |f| %> - <% if capture_secondary_id_enabled %> - <%= render ValidatedFieldComponent.new( - collection: us_states_territories, - form: f, - input_html: { class: 'address-state-selector' }, - label: t('idv.form.state'), - label_html: { class: 'usa-label' }, - name: :state, - prompt: t('in_person_proofing.form.address.state_prompt'), - required: true, - selected: pii[:state], - ) %> - <% end %> + <%= render ValidatedFieldComponent.new( + collection: us_states_territories, + form: f, + input_html: { class: 'address-state-selector' }, + label: t('idv.form.state'), + label_html: { class: 'usa-label' }, + name: :state, + prompt: t('in_person_proofing.form.address.state_prompt'), + required: true, + selected: pii[:state], + ) %> <%= render ValidatedFieldComponent.new( form: f, hint: t('in_person_proofing.form.state_id.address1_hint'), @@ -52,7 +37,7 @@ hint: t('in_person_proofing.form.state_id.address2_hint'), hint_html: { class: ['display-none', 'puerto-rico-extras'] }, input_html: { value: pii[:address2] }, - label: capture_secondary_id_enabled ? t('idv.form.address2') : t('idv.form.address2_optional'), + label: t('idv.form.address2'), label_html: { class: 'usa-label' }, maxlength: 255, name: :address2, @@ -68,19 +53,6 @@ required: true, ) %> - <% unless capture_secondary_id_enabled %> - <%= render ValidatedFieldComponent.new( - collection: us_states_territories, - form: f, - label: t('idv.form.state'), - label_html: { class: 'usa-label' }, - name: :state, - prompt: t('in_person_proofing.form.address.state_prompt'), - required: true, - selected: pii[:state], - ) %> - <% end %> -
<%# using :tel for mobile numeric keypad %> <%= render ValidatedFieldComponent.new( @@ -96,22 +68,6 @@ ) %>
- <% unless capture_secondary_id_enabled %> - <%= render ValidatedFieldComponent.new( - as: :radio_buttons, - checked: pii[:same_address_as_id], - collection: [ - [t('in_person_proofing.form.address.same_address_choice_yes'), true], - [t('in_person_proofing.form.address.same_address_choice_no'), false], - ], - form: f, - label: t('in_person_proofing.form.address.same_address'), - name: :same_address_as_id, - required: true, - wrapper: :uswds_radio_buttons, - ) %> - <% end %> - <%= f.submit class: 'margin-top-1' do %> <% if updating_address %> <%= t('forms.buttons.submit.update') %> diff --git a/app/views/idv/in_person/ready_to_verify/show.html.erb b/app/views/idv/in_person/ready_to_verify/show.html.erb index 120d7122ca1..1e28cf420c9 100644 --- a/app/views/idv/in_person/ready_to_verify/show.html.erb +++ b/app/views/idv/in_person/ready_to_verify/show.html.erb @@ -45,17 +45,6 @@ <% c.with_item(heading: t('in_person_proofing.process.state_id.heading')) do %>

<%= t('in_person_proofing.process.state_id.info') %>

<% end %> - <% if @presenter.needs_proof_of_address? %> - <% c.with_item(heading: t('in_person_proofing.process.proof_of_address.heading')) do %> -

<%= t('in_person_proofing.process.proof_of_address.info') %>

- -

<%= t('in_person_proofing.process.proof_of_address.physical_or_digital_copy') %>

- <% end %> - <% end %> <% end %>

<%= t('in_person_proofing.body.barcode.questions') %> diff --git a/app/views/idv/in_person/state_id.html.erb b/app/views/idv/in_person/state_id.html.erb index fed60a92539..4f1f255aafc 100644 --- a/app/views/idv/in_person/state_id.html.erb +++ b/app/views/idv/in_person/state_id.html.erb @@ -96,21 +96,19 @@ %> - <% if capture_secondary_id_enabled %> -

- <%= render ValidatedFieldComponent.new( - name: :state_id_jurisdiction, - collection: us_states_territories, - form: f, - hint: t('in_person_proofing.form.state_id.state_id_jurisdiction_hint'), - label: t('in_person_proofing.form.state_id.state_id_jurisdiction'), - label_html: { class: 'usa-label' }, - prompt: t('in_person_proofing.form.state_id.state_id_jurisdiction_prompt'), - required: true, - selected: pii[:state_id_jurisdiction], - ) %> -
- <% end %> +
+ <%= render ValidatedFieldComponent.new( + name: :state_id_jurisdiction, + collection: us_states_territories, + form: f, + hint: t('in_person_proofing.form.state_id.state_id_jurisdiction_hint'), + label: t('in_person_proofing.form.state_id.state_id_jurisdiction'), + label_html: { class: 'usa-label' }, + prompt: t('in_person_proofing.form.state_id.state_id_jurisdiction_prompt'), + required: true, + selected: pii[:state_id_jurisdiction], + ) %> +
<%= render ValidatedFieldComponent.new( name: :state_id_number, @@ -125,98 +123,79 @@ ) %>
- <% if capture_secondary_id_enabled %> -

<%= t('in_person_proofing.headings.id_address') %>

- <%= render ValidatedFieldComponent.new( - name: :identity_doc_address_state, - collection: us_states_territories, - form: f, - input_html: { class: 'address-state-selector' }, - label: t('in_person_proofing.form.state_id.identity_doc_address_state'), - label_html: { class: 'usa-label' }, - prompt: t('in_person_proofing.form.state_id.identity_doc_address_state_prompt'), - required: true, - selected: pii[:identity_doc_address_state], - ) %> - <%= render ValidatedFieldComponent.new( - name: :identity_doc_address1, - form: f, - hint_html: { class: ['display-none', 'puerto-rico-extras'] }, - hint: t('in_person_proofing.form.state_id.address1_hint'), - input_html: { value: pii[:identity_doc_address1] }, - label: t('in_person_proofing.form.state_id.address1'), - label_html: { class: 'usa-label' }, - maxlength: 255, - required: true, - ) %> +

<%= t('in_person_proofing.headings.id_address') %>

+ <%= render ValidatedFieldComponent.new( + name: :identity_doc_address_state, + collection: us_states_territories, + form: f, + input_html: { class: 'address-state-selector' }, + label: t('in_person_proofing.form.state_id.identity_doc_address_state'), + label_html: { class: 'usa-label' }, + prompt: t('in_person_proofing.form.state_id.identity_doc_address_state_prompt'), + required: true, + selected: pii[:identity_doc_address_state], + ) %> + <%= render ValidatedFieldComponent.new( + name: :identity_doc_address1, + form: f, + hint_html: { class: ['display-none', 'puerto-rico-extras'] }, + hint: t('in_person_proofing.form.state_id.address1_hint'), + input_html: { value: pii[:identity_doc_address1] }, + label: t('in_person_proofing.form.state_id.address1'), + label_html: { class: 'usa-label' }, + maxlength: 255, + required: true, + ) %> + + <%= render ValidatedFieldComponent.new( + name: :identity_doc_address2, + form: f, + hint: t('in_person_proofing.form.state_id.address2_hint'), + hint_html: { class: ['display-none', 'puerto-rico-extras'] }, + input_html: { value: pii[:identity_doc_address2] }, + label: t('in_person_proofing.form.state_id.address2'), + label_html: { class: 'usa-label' }, + maxlength: 255, + required: false, + ) %> - <%= render ValidatedFieldComponent.new( - name: :identity_doc_address2, - form: f, - hint: t('in_person_proofing.form.state_id.address2_hint'), - hint_html: { class: ['display-none', 'puerto-rico-extras'] }, - input_html: { value: pii[:identity_doc_address2] }, - label: t('in_person_proofing.form.state_id.address2'), - label_html: { class: 'usa-label' }, - maxlength: 255, - required: false, - ) %> - - <%= render ValidatedFieldComponent.new( - name: :identity_doc_city, - form: f, - input_html: { value: pii[:identity_doc_city] }, - label: t('in_person_proofing.form.state_id.city'), - label_html: { class: 'usa-label' }, - maxlength: 255, - required: true, - ) %> - <% end %> - <% unless capture_secondary_id_enabled %> -
- <%= render ValidatedFieldComponent.new( - name: :state_id_jurisdiction, - collection: us_states_territories, - form: f, - hint: t('in_person_proofing.form.state_id.identity_doc_address_state_hint'), - label: t('in_person_proofing.form.state_id.state_id_jurisdiction'), - label_html: { class: 'usa-label' }, - prompt: t('in_person_proofing.form.state_id.state_id_jurisdiction_prompt'), - required: true, - selected: pii[:state_id_jurisdiction], - ) %> -
- <% end %> - <% if capture_secondary_id_enabled %> -
- <%# using :tel for mobile numeric keypad %> - <%= render ValidatedFieldComponent.new( - as: :tel, - error_messages: { patternMismatch: t('idv.errors.pattern_mismatch.zipcode') }, - form: f, - input_html: { value: pii[:identity_doc_zipcode], class: 'zipcode' }, - label: t('in_person_proofing.form.state_id.zipcode'), - label_html: { class: 'usa-label' }, - name: :identity_doc_zipcode, - pattern: '\d{5}([\-]\d{4})?', - required: true, - ) %> -
<%= render ValidatedFieldComponent.new( - as: :radio_buttons, - checked: pii[:same_address_as_id], - collection: [ - [t('in_person_proofing.form.state_id.same_address_as_id_yes'), true], - [t('in_person_proofing.form.state_id.same_address_as_id_no'), false], - ], + name: :identity_doc_city, form: f, - label: t('in_person_proofing.form.state_id.same_address_as_id'), - legend_html: { class: 'h2' }, - name: :same_address_as_id, + input_html: { value: pii[:identity_doc_city] }, + label: t('in_person_proofing.form.state_id.city'), + label_html: { class: 'usa-label' }, + maxlength: 255, required: true, - wrapper: :uswds_radio_buttons, ) %> - <% end %> +
+ <%# using :tel for mobile numeric keypad %> + <%= render ValidatedFieldComponent.new( + as: :tel, + error_messages: { patternMismatch: t('idv.errors.pattern_mismatch.zipcode') }, + form: f, + input_html: { value: pii[:identity_doc_zipcode], class: 'zipcode' }, + label: t('in_person_proofing.form.state_id.zipcode'), + label_html: { class: 'usa-label' }, + name: :identity_doc_zipcode, + pattern: '\d{5}([\-]\d{4})?', + required: true, + ) %> +
+ <%= render ValidatedFieldComponent.new( + as: :radio_buttons, + checked: pii[:same_address_as_id], + collection: [ + [t('in_person_proofing.form.state_id.same_address_as_id_yes'), true], + [t('in_person_proofing.form.state_id.same_address_as_id_no'), false], + ], + form: f, + label: t('in_person_proofing.form.state_id.same_address_as_id'), + legend_html: { class: 'h2' }, + name: :same_address_as_id, + required: true, + wrapper: :uswds_radio_buttons, + ) %> <%= f.submit do %> <% if updating_state_id %> diff --git a/app/views/idv/in_person/verify_info/show.html.erb b/app/views/idv/in_person/verify_info/show.html.erb index 25ea23ca778..8dbb5d8573b 100644 --- a/app/views/idv/in_person/verify_info/show.html.erb +++ b/app/views/idv/in_person/verify_info/show.html.erb @@ -25,11 +25,9 @@ locals:
- <% if @capture_secondary_id_enabled %> -
-

<%= t('headings.state_id') %>

-
- <% end %> +
+

<%= t('headings.state_id') %>

+
<%= t('idv.form.first_name') %>:
<%= @pii[:first_name] %>
@@ -44,38 +42,34 @@ locals: <%= I18n.l(Date.parse(@pii[:dob]), format: I18n.t('time.formats.event_date')) %>
- <% if @capture_secondary_id_enabled %> -
-
<%= t('idv.form.issuing_state') %>:
-
<%= @pii[:state_id_jurisdiction] %>
-
- <% end %> +
+
<%= t('idv.form.issuing_state') %>:
+
<%= @pii[:state_id_jurisdiction] %>
+
<%= t('idv.form.id_number') %>:
<%= @pii[:state_id_number] %>
- <% if @capture_secondary_id_enabled %> -
-
<%= t('idv.form.address1') %>:
-
<%= @pii[:identity_doc_address1] %>
-
-
-
<%= t('idv.form.address2') %>:
-
<%= @pii[:identity_doc_address2].presence %>
-
-
-
<%= t('idv.form.city') %>:
-
<%= @pii[:identity_doc_city] %>
-
-
-
<%= t('idv.form.state') %>:
-
<%= @pii[:identity_doc_address_state] %>
-
-
-
<%= t('idv.form.zipcode') %>:
-
<%= @pii[:identity_doc_zipcode] %>
-
- <% end %> +
+
<%= t('idv.form.address1') %>:
+
<%= @pii[:identity_doc_address1] %>
+
+
+
<%= t('idv.form.address2') %>:
+
<%= @pii[:identity_doc_address2].presence %>
+
+
+
<%= t('idv.form.city') %>:
+
<%= @pii[:identity_doc_city] %>
+
+
+
<%= t('idv.form.state') %>:
+
<%= @pii[:identity_doc_address_state] %>
+
+
+
<%= t('idv.form.zipcode') %>:
+
<%= @pii[:identity_doc_zipcode] %>
+
<%= button_to( @@ -88,11 +82,9 @@ locals:
- <% if @capture_secondary_id_enabled %> -
-

<%= t('headings.residential_address') %>

-
- <% end %> +
+

<%= t('headings.residential_address') %>

+
<%= t('idv.form.address1') %>:
<%= @pii[:address1] %>
@@ -125,11 +117,9 @@ locals:
- <% if @capture_secondary_id_enabled %> -
-

<%= t('headings.ssn') %>

-
- <% end %> +
+

<%= t('headings.ssn') %>

+
<%= t('idv.form.ssn') %>: <%= render( 'shared/masked_text', diff --git a/app/views/user_mailer/in_person_failed.html.erb b/app/views/user_mailer/in_person_failed.html.erb index bd9117a6f34..4fe54f94d4c 100644 --- a/app/views/user_mailer/in_person_failed.html.erb +++ b/app/views/user_mailer/in_person_failed.html.erb @@ -16,9 +16,6 @@

<%= t('user_mailer.in_person_failed.verifying_identity') %>

  • <%= t('user_mailer.in_person_failed.verifying_step_not_expired') %>
  • - <% if @presenter.needs_proof_of_address? %> -
  • <%= t('user_mailer.in_person_failed.verifying_step_proof_of_address') %>
  • - <% end %>
<%= render 'shared/in-person-verification-results-email-lower' %> diff --git a/app/views/user_mailer/shared/_in_person_ready_to_verify.html.erb b/app/views/user_mailer/shared/_in_person_ready_to_verify.html.erb index ae55ab5aa3b..f033c58e5d7 100644 --- a/app/views/user_mailer/shared/_in_person_ready_to_verify.html.erb +++ b/app/views/user_mailer/shared/_in_person_ready_to_verify.html.erb @@ -62,21 +62,6 @@

<%= t('in_person_proofing.process.state_id.info') %>

- <% if @presenter.needs_proof_of_address? %> - -
4
- -

<%= t('in_person_proofing.process.proof_of_address.heading') %>

-

<%= t('in_person_proofing.process.proof_of_address.info') %>

-
    - <% t('in_person_proofing.process.proof_of_address.acceptable_proof').each do |proof| %> -
  • <%= proof %>
  • - <% end %> -
-

<%= t('in_person_proofing.process.proof_of_address.physical_or_digital_copy') %>

- - - <% end %>

<%= t('in_person_proofing.body.barcode.questions') %> diff --git a/config/application.yml.default b/config/application.yml.default index 4c183ce2dd8..43449f66b72 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -124,7 +124,6 @@ idv_phone_question_a_b_testing: '{"show_phone_question":0}' idv_send_link_attempt_window_in_minutes: 10 idv_send_link_max_attempts: 5 idv_sp_required: false -in_person_capture_secondary_id_enabled: false in_person_public_address_search_enabled: false in_person_doc_auth_button_enabled: true in_person_email_reminder_early_benchmark_in_days: 11 diff --git a/config/locales/idv/en.yml b/config/locales/idv/en.yml index f8dc1e77926..df634585054 100644 --- a/config/locales/idv/en.yml +++ b/config/locales/idv/en.yml @@ -155,7 +155,6 @@ en: form: address1: Address line 1 address2: Address line 2 - address2_optional: Address line 2 (optional) city: City dob: Date of birth first_name: First name diff --git a/config/locales/idv/es.yml b/config/locales/idv/es.yml index b1a6cbf0651..4c45635d0ab 100644 --- a/config/locales/idv/es.yml +++ b/config/locales/idv/es.yml @@ -163,7 +163,6 @@ es: form: address1: Línea de dirección 1 address2: Línea de dirección 2 - address2_optional: Línea de dirección 2 (opcional) city: Ciudad dob: Fecha de nacimiento first_name: Nombre diff --git a/config/locales/idv/fr.yml b/config/locales/idv/fr.yml index df4505db784..a774e803be7 100644 --- a/config/locales/idv/fr.yml +++ b/config/locales/idv/fr.yml @@ -169,7 +169,6 @@ fr: form: address1: Adresse ligne 1 address2: Adresse ligne 2 - address2_optional: Adresse ligne 2 (optional) city: Ville dob: Date de naissance first_name: Prénom diff --git a/config/locales/in_person_proofing/en.yml b/config/locales/in_person_proofing/en.yml index 0978956cad4..22962daf2ed 100644 --- a/config/locales/in_person_proofing/en.yml +++ b/config/locales/in_person_proofing/en.yml @@ -2,10 +2,6 @@ en: in_person_proofing: body: - address: - info: If your current address does not match the address on your ID, you will - need to bring proof of your current address to the Post Office. - learn_more: Learn more barcode: cancel_link_text: Cancel your barcode close_window: You may now close this window. @@ -93,10 +89,6 @@ en: unsupported_chars: 'Our system cannot read the following characters: %{char_list}. Please try again using substitutes for those characters.' - same_address: Is this address displayed on the state‑issued ID that you are - bringing to the Post Office? - same_address_choice_no: I have a different address on my ID - same_address_choice_yes: This address is on my state‑issued ID state_prompt: '- Select -' state_id: address1: Address line 1 @@ -115,7 +107,6 @@ en: %{char_list}. Please try again using the characters on your ID.' first_name: First name identity_doc_address_state: State - identity_doc_address_state_hint: Select the state shown on your ID identity_doc_address_state_prompt: '- Select -' last_name: Last name memorable_date: @@ -158,18 +149,6 @@ en: heading: Show your %{app_name} barcode info: The retail associate needs to scan your barcode at the top of this page. You can print this page or show it on your mobile device. - proof_of_address: - acceptable_proof: - - Lease, Mortgage, or Deed of Trust - - Voter Registration - - Vehicle Registration Card - - Home or Vehicle Insurance Policy - heading: Proof of your current address - info: 'You need a proof of address if your current address is different than the - address on your ID. Acceptable forms of proof of address are:' - physical_or_digital_copy: You can bring a physical copy or show a digital copy - of the document. You cannot show a photo or screenshot of the - document. state_id: heading: Show your State Driver’s License or State Non-Driver’s Identification Card diff --git a/config/locales/in_person_proofing/es.yml b/config/locales/in_person_proofing/es.yml index e4e96b00edc..812b0e144ce 100644 --- a/config/locales/in_person_proofing/es.yml +++ b/config/locales/in_person_proofing/es.yml @@ -2,11 +2,6 @@ es: in_person_proofing: body: - address: - info: Si su dirección actual no coincide con la que figura en su cédula de - identidad, deberá llevar a la oficina de correos un comprobante de su - dirección actual. - learn_more: Aprende más barcode: cancel_link_text: Cancelar su código de barras close_window: Ya puede cerrar esta ventana @@ -105,10 +100,6 @@ es: unsupported_chars: 'Los siguientes caracteres no pueden ser leídos por nuestro sistema: %{char_list}. Inténtelo nuevamente usando sustitutos para estos caracteres.' - same_address: '¿Aparece esta dirección en la cédula de identidad emitido por el - Estado que va a llevar a la oficina de Correos?' - same_address_choice_no: Tengo una dirección diferente en mi cédula de identidad - same_address_choice_yes: Esta dirección aparece en mi cédula de identidad emitida por el estado state_prompt: '- Seleccione -' state_id: address1: Línea de dirección 1 @@ -128,7 +119,6 @@ es: su documento de identidad.' first_name: Nombre identity_doc_address_state: Estado emisor - identity_doc_address_state_hint: Este es el estado que emitió su identificación identity_doc_address_state_prompt: '- Seleccione -' last_name: Apellido memorable_date: @@ -174,19 +164,6 @@ es: info: El empleado deberá escanear el código de barras que aparece en la parte superior de esta página. Puede imprimir esta página o mostrarla en su dispositivo móvil. - proof_of_address: - acceptable_proof: - - Arrendamiento, hipoteca o escritura de fideicomiso - - Registro de votantes - - Tarjeta de registro del vehículo - - Póliza de seguro del hogar o del vehículo - heading: Prueba de su dirección actual - info: 'Necesita un justificante de domicilio si su dirección actual es diferente - a la que figura en su cédula de identidad. Los comprobantes de - domicilio aceptables son:' - physical_or_digital_copy: Puede traer una copia física o mostrar una copia - digital del documento. No puede mostrar una foto o una captura de - pantalla del documento. state_id: heading: Muestre su licencia de conducir estatal o su tarjeta de identificación estatal de no conductor diff --git a/config/locales/in_person_proofing/fr.yml b/config/locales/in_person_proofing/fr.yml index 4e0468bd9f6..196b4ac8dc5 100644 --- a/config/locales/in_person_proofing/fr.yml +++ b/config/locales/in_person_proofing/fr.yml @@ -2,11 +2,6 @@ fr: in_person_proofing: body: - address: - info: Si votre adresse actuelle ne correspond pas à l’adresse figurant sur votre - document d’identité, vous devrez apporter une preuve de votre adresse - actuelle au bureau de poste. - learn_more: Apprendre encore plus barcode: cancel_link_text: Annulez votre code-barres close_window: Vous pouvez maintenant fermer cette fenêtre @@ -104,10 +99,6 @@ fr: unsupported_chars: 'Notre système ne parvient pas à lire les caractères suivants : %{char_list}. Veuillez réessayer en utilisant d’autres caractères alternatifs.' - same_address: Cette adresse figure-t-elle sur la pièce d’identité délivrée par - l’État que vous apportez au bureau de poste? - same_address_choice_no: J’ai une adresse différente sur mon document d’identité - same_address_choice_yes: Cette adresse figure sur mon document d’identité nationale state_prompt: '- Sélectionnez -' state_id: address1: Adresse ligne 1 @@ -127,7 +118,6 @@ fr: votre carte d’identité.' first_name: Prénom identity_doc_address_state: État émetteur - identity_doc_address_state_hint: Il s’agit de l’État qui a émis votre pièce d’identité identity_doc_address_state_prompt: '- Sélectionnez -' last_name: Nom de famille memorable_date: @@ -174,19 +164,6 @@ fr: heading: Montrez votre code-barres %{app_name} info: Le vendeur doit scanner votre code-barres en haut de cette page. Vous pouvez imprimer cette page ou la montrer sur votre appareil mobile. - proof_of_address: - acceptable_proof: - - Bail, hypothèque ou acte de fiducie - - Inscription sur les listes électorales - - Carte d’immatriculation du véhicule - - Police d’assurance habitation ou véhicule - heading: Preuve de votre adresse actuelle - info: 'Vous avez besoin d’un justificatif de domicile si votre adresse actuelle - est différente de l’adresse figurant sur votre document d’identité. - Les justificatifs d’adresse acceptés sont les suivants:' - physical_or_digital_copy: Vous pouvez apporter une copie physique ou montrer une - copie numérique du document. Vous ne pouvez pas montrer une photo ou - une capture d’écran du document. state_id: heading: Présentez votre permis de conduire de l’État ou votre carte d’identité de non-conducteur de l’État diff --git a/config/locales/user_mailer/en.yml b/config/locales/user_mailer/en.yml index 07c46f4d308..6fdf667b388 100644 --- a/config/locales/user_mailer/en.yml +++ b/config/locales/user_mailer/en.yml @@ -129,9 +129,6 @@ en: verifying_step_not_expired: Your state‑issued ID or driver’s license must not be expired. We do not currently accept any other forms of identification, such as passports and military IDs. - verifying_step_proof_of_address: If you try to verify your identity in person - again, you need to bring a valid proof of address if your current - address is different than the address on your ID. in_person_failed_suspected_fraud: body: help_center_html: If you need further help, you can { - success: true, flow_path: 'standard', step: 'state_id', step_count: 1, analytics_id: 'In Person Proofing', irs_reproofing: false, errors: {}, same_address_as_id: nil + success: true, flow_path: 'standard', step: 'state_id', step_count: 1, analytics_id: 'In Person Proofing', irs_reproofing: false, errors: {}, same_address_as_id: false }, 'IdV: in person proofing address visited' => { - step: 'address', flow_path: 'standard', step_count: 1, analytics_id: 'In Person Proofing', irs_reproofing: false + step: 'address', flow_path: 'standard', step_count: 1, analytics_id: 'In Person Proofing', irs_reproofing: false, same_address_as_id: false }, - 'IdV: in person proofing address submitted' => { - success: true, step: 'address', flow_path: 'standard', step_count: 1, analytics_id: 'In Person Proofing', irs_reproofing: false, errors: {}, same_address_as_id: true + 'IdV: in person proofing residential address submitted' => { + success: true, step: 'address', flow_path: 'standard', step_count: 1, analytics_id: 'In Person Proofing', irs_reproofing: false, errors: {}, same_address_as_id: false }, 'IdV: doc auth ssn visited' => { - analytics_id: 'In Person Proofing', step: 'ssn', flow_path: 'standard', irs_reproofing: false, getting_started_ab_test_bucket: :welcome_default, acuant_sdk_upgrade_ab_test_bucket: :default, skip_hybrid_handoff: nil, same_address_as_id: true + analytics_id: 'In Person Proofing', step: 'ssn', flow_path: 'standard', irs_reproofing: false, getting_started_ab_test_bucket: :welcome_default, acuant_sdk_upgrade_ab_test_bucket: :default, skip_hybrid_handoff: nil, same_address_as_id: false }, 'IdV: doc auth ssn submitted' => { - analytics_id: 'In Person Proofing', success: true, step: 'ssn', flow_path: 'standard', irs_reproofing: false, errors: {}, getting_started_ab_test_bucket: :welcome_default, acuant_sdk_upgrade_ab_test_bucket: :default, skip_hybrid_handoff: nil, same_address_as_id: true + analytics_id: 'In Person Proofing', success: true, step: 'ssn', flow_path: 'standard', irs_reproofing: false, errors: {}, getting_started_ab_test_bucket: :welcome_default, acuant_sdk_upgrade_ab_test_bucket: :default, skip_hybrid_handoff: nil, same_address_as_id: false }, 'IdV: doc auth verify visited' => { - analytics_id: 'In Person Proofing', step: 'verify', flow_path: 'standard', irs_reproofing: false, same_address_as_id: true, getting_started_ab_test_bucket: :welcome_default, acuant_sdk_upgrade_ab_test_bucket: :default, skip_hybrid_handoff: nil + analytics_id: 'In Person Proofing', step: 'verify', flow_path: 'standard', irs_reproofing: false, same_address_as_id: false, getting_started_ab_test_bucket: :welcome_default, acuant_sdk_upgrade_ab_test_bucket: :default, skip_hybrid_handoff: nil }, 'IdV: doc auth verify submitted' => { - analytics_id: 'In Person Proofing', step: 'verify', flow_path: 'standard', irs_reproofing: false, same_address_as_id: true, getting_started_ab_test_bucket: :welcome_default, acuant_sdk_upgrade_ab_test_bucket: :default, skip_hybrid_handoff: nil + analytics_id: 'In Person Proofing', step: 'verify', flow_path: 'standard', irs_reproofing: false, same_address_as_id: false, getting_started_ab_test_bucket: :welcome_default, acuant_sdk_upgrade_ab_test_bucket: :default, skip_hybrid_handoff: nil }, 'IdV: doc auth verify proofing results' => { success: true, errors: {}, flow_path: 'standard', address_edited: false, address_line2_present: false, analytics_id: 'In Person Proofing', ssn_is_unique: true, step: 'verify', acuant_sdk_upgrade_ab_test_bucket: :default, getting_started_ab_test_bucket: :welcome_default, irs_reproofing: false, skip_hybrid_handoff: nil, - proofing_results: { exception: nil, timed_out: false, threatmetrix_review_status: 'pass', context: { device_profiling_adjudication_reason: 'device_profiling_result_pass', double_address_verification: false, resolution_adjudication_reason: 'pass_resolution_and_state_id', should_proof_state_id: true, stages: { resolution: { success: true, errors: {}, exception: nil, timed_out: false, transaction_id: 'resolution-mock-transaction-id-123', reference: 'aaa-bbb-ccc', can_pass_with_additional_verification: false, attributes_requiring_additional_verification: [], vendor_name: 'ResolutionMock', vendor_workflow: nil }, residential_address: { errors: {}, exception: nil, reference: '', success: true, timed_out: false, transaction_id: '', vendor_name: 'ResidentialAddressNotRequired' }, state_id: { success: true, errors: {}, exception: nil, mva_exception: nil, timed_out: false, transaction_id: 'state-id-mock-transaction-id-456', vendor_name: 'StateIdMock', verified_attributes: [], state: 'MT', state_id_jurisdiction: 'ND', state_id_number: '#############' }, threatmetrix: threatmetrix_response } } } + proofing_results: { exception: nil, timed_out: false, threatmetrix_review_status: 'pass', context: { device_profiling_adjudication_reason: 'device_profiling_result_pass', double_address_verification: true, resolution_adjudication_reason: 'pass_resolution_and_state_id', should_proof_state_id: true, stages: { resolution: { success: true, errors: {}, exception: nil, timed_out: false, transaction_id: 'resolution-mock-transaction-id-123', reference: 'aaa-bbb-ccc', can_pass_with_additional_verification: false, attributes_requiring_additional_verification: [], vendor_name: 'ResolutionMock', vendor_workflow: nil }, residential_address: { errors: {}, exception: nil, reference: 'aaa-bbb-ccc', success: true, timed_out: false, transaction_id: 'resolution-mock-transaction-id-123', can_pass_with_additional_verification: false, attributes_requiring_additional_verification: [], vendor_name: 'ResolutionMock', vendor_workflow: nil }, state_id: { success: true, errors: {}, exception: nil, mva_exception: nil, timed_out: false, transaction_id: 'state-id-mock-transaction-id-456', vendor_name: 'StateIdMock', verified_attributes: [], state: 'MT', state_id_jurisdiction: 'ND', state_id_number: '#############' }, threatmetrix: threatmetrix_response } } } }, 'IdV: phone confirmation form' => { success: true, errors: {}, phone_type: :mobile, types: [:fixed_or_mobile], carrier: 'Test Mobile Carrier', country_code: 'US', area_code: '202', acuant_sdk_upgrade_ab_test_bucket: :default, getting_started_ab_test_bucket: :welcome_default, skip_hybrid_handoff: nil, otp_delivery_preference: 'sms', @@ -482,8 +482,6 @@ before do allow(IdentityConfig.store).to receive(:in_person_proofing_enabled).and_return(true) - allow(IdentityConfig.store).to receive(:in_person_capture_secondary_id_enabled). - and_return(false) allow(Idv::InPersonConfig).to receive(:enabled_for_issuer?).and_return(true) allow_any_instance_of(Idv::InPerson::ReadyToVerifyPresenter). to receive(:service_provider_homepage_url).and_return(return_sp_url) @@ -493,7 +491,7 @@ start_idv_from_sp(:saml) sign_in_and_2fa_user(user) begin_in_person_proofing(user) - complete_all_in_person_proofing_steps(user) + complete_all_in_person_proofing_steps(user, same_address_as_id: false) complete_phone_step(user) complete_review_step(user) acknowledge_and_confirm_personal_key diff --git a/spec/features/idv/in_person_spec.rb b/spec/features/idv/in_person_spec.rb index 14fe80b0713..d73385ebc91 100644 --- a/spec/features/idv/in_person_spec.rb +++ b/spec/features/idv/in_person_spec.rb @@ -8,8 +8,6 @@ before do allow(IdentityConfig.store).to receive(:in_person_proofing_enabled).and_return(true) - allow(IdentityConfig.store).to receive(:in_person_capture_secondary_id_enabled). - and_return(false) end context 'ThreatMetrix review pending' do @@ -32,9 +30,6 @@ # state ID page complete_state_id_step(user) - # address page - complete_address_step(user) - # ssn page select 'Reject', from: :mock_profiling_result complete_ssn_step(user) @@ -47,10 +42,14 @@ expect(page).to have_text(InPersonHelper::GOOD_LAST_NAME) expect(page).to have_text(InPersonHelper::GOOD_DOB_FORMATTED_EVENT) expect(page).to have_text(InPersonHelper::GOOD_STATE_ID_NUMBER) - expect(page).to have_text(InPersonHelper::GOOD_ADDRESS1) - expect(page).to have_text(InPersonHelper::GOOD_CITY) - expect(page).to have_text(InPersonHelper::GOOD_ZIPCODE) - expect(page).to have_text(Idp::Constants::MOCK_IDV_APPLICANT[:state]) + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ADDRESS1).twice + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ADDRESS2).twice + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_CITY).twice + expect(page).to have_text( + Idp::Constants::MOCK_IDV_APPLICANT[:state_id_jurisdiction], + count: 3, + ) + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ZIPCODE).twice expect(page).to have_text(DocAuthHelper::GOOD_SSN_MASKED) complete_verify_step(user) @@ -138,12 +137,6 @@ ) complete_state_id_step(user) - # address page - expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.verify_info')) - expect(page).to have_content(t('in_person_proofing.headings.address')) - expect(page).to have_content(t('in_person_proofing.form.address.same_address').tr(' ', ' ')) - complete_address_step(user) - # ssn page expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.verify_info')) expect(page).to have_content(t('doc_auth.headings.ssn')) @@ -157,15 +150,17 @@ expect(page).to have_text(InPersonHelper::GOOD_LAST_NAME) expect(page).to have_text(InPersonHelper::GOOD_DOB_FORMATTED_EVENT) expect(page).to have_text(InPersonHelper::GOOD_STATE_ID_NUMBER) - expect(page).to have_text(InPersonHelper::GOOD_ADDRESS1) - expect(page).to have_text(InPersonHelper::GOOD_CITY) - expect(page).to have_text(InPersonHelper::GOOD_ZIPCODE) - expect(page).to have_text(Idp::Constants::MOCK_IDV_APPLICANT[:state]) + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ADDRESS1).twice + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ADDRESS2).twice + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_CITY).twice + expect(page).to have_text(Idp::Constants::MOCK_IDV_APPLICANT[:state_id_jurisdiction], count: 3) + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ZIPCODE).twice expect(page).to have_text(DocAuthHelper::GOOD_SSN_MASKED) # click update state ID button click_button t('idv.buttons.change_state_id_label') expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) + choose t('in_person_proofing.form.state_id.same_address_as_id_yes') click_button t('forms.buttons.submit.update') expect(page).to have_content(t('headings.verify')) expect(page).to have_current_path(idv_in_person_verify_info_path) @@ -173,7 +168,6 @@ # click update address button click_button t('idv.buttons.change_address_label') expect(page).to have_content(t('in_person_proofing.headings.update_address')) - choose t('in_person_proofing.form.address.same_address_choice_yes') click_button t('forms.buttons.submit.update') expect(page).to have_content(t('headings.verify')) expect(page).to have_current_path(idv_in_person_verify_info_path) @@ -324,7 +318,8 @@ end end - it 'resumes desktop session with in-person proofing', allow_browser_log: true do + it 'resumes desktop session with in-person proofing when same_address_as_id is true', + allow_browser_log: true do user = nil perform_in_browser(:desktop) do @@ -338,38 +333,27 @@ expect(@sms_link).to be_present - perform_in_browser(:mobile) do - # doc auth page - visit @sms_link - mock_doc_auth_attention_with_barcode - attach_and_submit_images - - # error page - click_button t('in_person_proofing.body.cta.button') - # prepare page - expect(page).to(have_content(t('in_person_proofing.body.prepare.verify_step_about'))) - click_idv_continue - # location page - expect(page).to have_content(t('in_person_proofing.headings.po_search.location')) - complete_location_step - - # switch back page - expect(page).to have_content(t('in_person_proofing.headings.switch_back')) - end + perform_mobile_hybrid_steps + perform_desktop_hybrid_steps(user) + end + + it 'resumes desktop session with in-person proofing when same_address_as_id is false', + allow_browser_log: true do + user = nil perform_in_browser(:desktop) do - expect(page).to have_current_path(idv_in_person_step_path(step: :state_id), wait: 10) - - complete_state_id_step(user) - complete_address_step(user) - complete_ssn_step(user) - complete_verify_step(user) - complete_phone_step(user) - complete_review_step(user) - acknowledge_and_confirm_personal_key + user = sign_in_and_2fa_user + complete_doc_auth_steps_before_hybrid_handoff_step + clear_and_fill_in(:doc_auth_phone, '415-555-0199') + click_send_link - expect(page).to have_content('MILWAUKEE') + expect(page).to have_content(t('doc_auth.headings.text_message')) end + + expect(@sms_link).to be_present + + perform_mobile_hybrid_steps + perform_desktop_hybrid_steps(user, same_address_as_id: false) end end @@ -435,333 +419,213 @@ and_return(true) end - context 'with double address verification' do - let(:capture_secondary_id_enabled) { true } - let(:double_address_verification) { true } - let(:user) { user_with_2fa } - let(:enrollment) { InPersonEnrollment.new(capture_secondary_id_enabled:) } - - before do - allow(IdentityConfig.store).to receive(:in_person_capture_secondary_id_enabled). - and_return(true) - allow(user).to receive(:establishing_in_person_enrollment). - and_return(enrollment) - end - - it 'shows validation errors when double address verification is true', - allow_browser_log: true do - sign_in_and_2fa_user - begin_in_person_proofing - complete_prepare_step - complete_location_step - expect(page).to have_current_path(idv_in_person_step_path(step: :state_id), wait: 10) - - fill_out_state_id_form_ok(capture_secondary_id_enabled: capture_secondary_id_enabled) - fill_in t('in_person_proofing.form.state_id.first_name'), with: 'T0mmy "Lee"' - fill_in t('in_person_proofing.form.state_id.last_name'), with: 'Джейкоб' - fill_in t('in_person_proofing.form.state_id.address1'), with: '#1 $treet' - fill_in t('in_person_proofing.form.state_id.address2'), with: 'Gr@nd Lañe^' - fill_in t('in_person_proofing.form.state_id.city'), with: 'B3st C!ty' - click_idv_continue - - expect(page).to have_content( - I18n.t( - 'in_person_proofing.form.state_id.errors.unsupported_chars', - char_list: '", 0', - ), - ) - - expect(page).to have_content( - I18n.t( - 'in_person_proofing.form.state_id.errors.unsupported_chars', - char_list: 'Д, б, е, ж, й, к, о', - ), - ) - - expect(page).to have_content( - I18n.t( - 'in_person_proofing.form.state_id.errors.unsupported_chars', - char_list: '$', - ), - ) - - expect(page).to have_content( - I18n.t( - 'in_person_proofing.form.state_id.errors.unsupported_chars', - char_list: '@, ^', - ), - ) - - expect(page).to have_content( - I18n.t( - 'in_person_proofing.form.state_id.errors.unsupported_chars', - char_list: '!, 3', - ), - ) - - # re-fill state id form with good inputs - fill_in t('in_person_proofing.form.state_id.first_name'), - with: InPersonHelper::GOOD_FIRST_NAME - fill_in t('in_person_proofing.form.state_id.last_name'), - with: InPersonHelper::GOOD_LAST_NAME - fill_in t('in_person_proofing.form.state_id.address1'), - with: InPersonHelper::GOOD_IDENTITY_DOC_ADDRESS1 - fill_in t('in_person_proofing.form.state_id.address2'), - with: InPersonHelper::GOOD_IDENTITY_DOC_ADDRESS2 - fill_in t('in_person_proofing.form.state_id.city'), - with: InPersonHelper::GOOD_IDENTITY_DOC_CITY - click_idv_continue - - expect(page).to have_current_path(idv_in_person_step_path(step: :address), wait: 10) - end + let(:user) { user_with_2fa } + let(:enrollment) { InPersonEnrollment.new } - it 'shows hints when user selects Puerto Rico as state', - allow_browser_log: true do - sign_in_and_2fa_user - begin_in_person_proofing - complete_prepare_step - complete_location_step - expect(page).to have_current_path(idv_in_person_step_path(step: :state_id), wait: 10) - - # state id page - select 'Puerto Rico', - from: t('in_person_proofing.form.state_id.identity_doc_address_state') - - expect(page).to have_content(I18n.t('in_person_proofing.form.state_id.address1_hint')) - expect(page).to have_content(I18n.t('in_person_proofing.form.state_id.address2_hint')) - - # change state selection - fill_out_state_id_form_ok(capture_secondary_id_enabled: true) - expect(page).not_to have_content(I18n.t('in_person_proofing.form.state_id.address1_hint')) - expect(page).not_to have_content(I18n.t('in_person_proofing.form.state_id.address2_hint')) - - # re-select puerto rico - select 'Puerto Rico', - from: t('in_person_proofing.form.state_id.identity_doc_address_state') - click_idv_continue - - expect(page).to have_current_path(idv_in_person_step_path(step: :address)) - - # address form - select 'Puerto Rico', - from: t('idv.form.state') - expect(page).to have_content(I18n.t('in_person_proofing.form.state_id.address1_hint')) - expect(page).to have_content(I18n.t('in_person_proofing.form.state_id.address2_hint')) - - # change selection - fill_out_address_form_ok(double_address_verification: true) - expect(page).not_to have_content(I18n.t('in_person_proofing.form.state_id.address1_hint')) - expect(page).not_to have_content(I18n.t('in_person_proofing.form.state_id.address2_hint')) - - # re-select puerto rico - select 'Puerto Rico', - from: t('idv.form.state') - click_idv_continue - - # ssn page - expect(page).to have_current_path(idv_in_person_ssn_url) - complete_ssn_step - - # verify page - expect(page).to have_current_path(idv_in_person_verify_info_path) - expect(page).to have_text('PR').twice - - # update state ID - click_button t('idv.buttons.change_state_id_label') - - expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) - expect(page).to have_content(I18n.t('in_person_proofing.form.state_id.address1_hint')) - expect(page).to have_content(I18n.t('in_person_proofing.form.state_id.address2_hint')) - click_button t('forms.buttons.submit.update') - - # update address - click_button t('idv.buttons.change_address_label') - - expect(page).to have_content(t('in_person_proofing.headings.update_address')) - expect(page).to have_content(I18n.t('in_person_proofing.form.state_id.address1_hint')) - expect(page).to have_content(I18n.t('in_person_proofing.form.state_id.address2_hint')) - end + before do + allow(user).to receive(:establishing_in_person_enrollment). + and_return(enrollment) end - context 'without double address verification' do - it 'shows validation errors when double address verification is false', - allow_browser_log: true do - sign_in_and_2fa_user - begin_in_person_proofing - complete_prepare_step - complete_location_step - expect(page).to have_current_path(idv_in_person_step_path(step: :state_id), wait: 10) - - fill_out_state_id_form_ok - fill_in t('in_person_proofing.form.state_id.first_name'), with: 'T0mmy "Lee"' - fill_in t('in_person_proofing.form.state_id.last_name'), with: 'Джейкоб' - click_idv_continue - - expect(page).to have_content( - I18n.t( - 'in_person_proofing.form.state_id.errors.unsupported_chars', - char_list: '", 0', - ), - ) - - expect(page).to have_content( - I18n.t( - 'in_person_proofing.form.state_id.errors.unsupported_chars', - char_list: 'Д, б, е, ж, й, к, о', - ), - ) - - # re-fill form with good inputs - fill_in t('in_person_proofing.form.state_id.first_name'), - with: InPersonHelper::GOOD_FIRST_NAME - fill_in t('in_person_proofing.form.state_id.last_name'), - with: InPersonHelper::GOOD_LAST_NAME - click_idv_continue - - expect(page).to have_current_path(idv_in_person_step_path(step: :address), wait: 10) - fill_out_address_form_ok - - fill_in t('idv.form.address1'), with: 'Джордж' - fill_in t('idv.form.address2_optional'), with: '(Nope) = %' - fill_in t('idv.form.city'), with: 'Елена' - click_idv_continue - - expect(page).to have_content( - I18n.t( - 'in_person_proofing.form.address.errors.unsupported_chars', - char_list: 'Д, д, ж, о, р', - ), - ) - - expect(page).to have_content( - I18n.t( - 'in_person_proofing.form.address.errors.unsupported_chars', - char_list: '%, (, ), =', - ), - ) - - expect(page).to have_content( - I18n.t( - 'in_person_proofing.form.address.errors.unsupported_chars', - char_list: 'Е, а, е, л, н', - ), - ) - - # re-fill form with good inputs - fill_in t('idv.form.address1'), with: InPersonHelper::GOOD_ADDRESS1 - fill_in t('idv.form.address2_optional'), with: InPersonHelper::GOOD_ADDRESS2 - fill_in t('idv.form.city'), with: InPersonHelper::GOOD_CITY - click_idv_continue - expect(page).to have_current_path(idv_in_person_ssn_url, wait: 10) - end - end - end + it 'shows validation errors', + allow_browser_log: true do + sign_in_and_2fa_user + begin_in_person_proofing + complete_prepare_step + complete_location_step + expect(page).to have_current_path(idv_in_person_step_path(step: :state_id), wait: 10) + + fill_out_state_id_form_ok + fill_in t('in_person_proofing.form.state_id.first_name'), with: 'T0mmy "Lee"' + fill_in t('in_person_proofing.form.state_id.last_name'), with: 'Джейкоб' + fill_in t('in_person_proofing.form.state_id.address1'), with: '#1 $treet' + fill_in t('in_person_proofing.form.state_id.address2'), with: 'Gr@nd Lañe^' + fill_in t('in_person_proofing.form.state_id.city'), with: 'B3st C!ty' + click_idv_continue - context 'in_person_capture_secondary_id_enabled feature flag disabled, then enabled during flow', - allow_browser_log: true do - let(:user) { user_with_2fa } + expect(page).to have_content( + I18n.t( + 'in_person_proofing.form.state_id.errors.unsupported_chars', + char_list: '", 0', + ), + ) - before(:each) do - allow(IdentityConfig.store).to receive(:in_person_capture_secondary_id_enabled). - and_return(false) + expect(page).to have_content( + I18n.t( + 'in_person_proofing.form.state_id.errors.unsupported_chars', + char_list: 'Д, б, е, ж, й, к, о', + ), + ) - sign_in_and_2fa_user(user) - begin_in_person_proofing(user) - complete_prepare_step(user) - complete_location_step(user) + expect(page).to have_content( + I18n.t( + 'in_person_proofing.form.state_id.errors.unsupported_chars', + char_list: '$', + ), + ) + + expect(page).to have_content( + I18n.t( + 'in_person_proofing.form.state_id.errors.unsupported_chars', + char_list: '@, ^', + ), + ) + + expect(page).to have_content( + I18n.t( + 'in_person_proofing.form.state_id.errors.unsupported_chars', + char_list: '!, 3', + ), + ) + + # re-fill state id form with good inputs + fill_in t('in_person_proofing.form.state_id.first_name'), + with: InPersonHelper::GOOD_FIRST_NAME + fill_in t('in_person_proofing.form.state_id.last_name'), + with: InPersonHelper::GOOD_LAST_NAME + fill_in t('in_person_proofing.form.state_id.address1'), + with: InPersonHelper::GOOD_IDENTITY_DOC_ADDRESS1 + fill_in t('in_person_proofing.form.state_id.address2'), + with: InPersonHelper::GOOD_IDENTITY_DOC_ADDRESS2 + fill_in t('in_person_proofing.form.state_id.city'), + with: InPersonHelper::GOOD_IDENTITY_DOC_CITY + click_idv_continue + + expect(page).to have_current_path(idv_in_person_step_path(step: :address), wait: 10) end - it 'does not capture separate state id address from residential address' do - allow(IdentityConfig.store).to receive(:in_person_capture_secondary_id_enabled). - and_return(true) - complete_state_id_step(user) - complete_address_step(user) - complete_ssn_step(user) + it 'shows hints when user selects Puerto Rico as state', + allow_browser_log: true do + sign_in_and_2fa_user + begin_in_person_proofing + complete_prepare_step + complete_location_step + expect(page).to have_current_path(idv_in_person_step_path(step: :state_id), wait: 10) + + # state id page + select 'Puerto Rico', + from: t('in_person_proofing.form.state_id.identity_doc_address_state') + + expect(page).to have_content(I18n.t('in_person_proofing.form.state_id.address1_hint')) + expect(page).to have_content(I18n.t('in_person_proofing.form.state_id.address2_hint')) + + # change state selection + fill_out_state_id_form_ok + expect(page).not_to have_content(I18n.t('in_person_proofing.form.state_id.address1_hint')) + expect(page).not_to have_content(I18n.t('in_person_proofing.form.state_id.address2_hint')) + + # re-select puerto rico + select 'Puerto Rico', + from: t('in_person_proofing.form.state_id.identity_doc_address_state') + click_idv_continue + + expect(page).to have_current_path(idv_in_person_step_path(step: :address)) + + # address form + select 'Puerto Rico', + from: t('idv.form.state') + expect(page).to have_content(I18n.t('in_person_proofing.form.state_id.address1_hint')) + expect(page).to have_content(I18n.t('in_person_proofing.form.state_id.address2_hint')) + + # change selection + fill_out_address_form_ok + expect(page).not_to have_content(I18n.t('in_person_proofing.form.state_id.address1_hint')) + expect(page).not_to have_content(I18n.t('in_person_proofing.form.state_id.address2_hint')) + + # re-select puerto rico + select 'Puerto Rico', + from: t('idv.form.state') + click_idv_continue + + # ssn page + expect(page).to have_current_path(idv_in_person_ssn_url) + complete_ssn_step + + # verify page + expect(page).to have_current_path(idv_in_person_verify_info_path) + expect(page).to have_text('PR').twice + + # update state ID + click_button t('idv.buttons.change_state_id_label') + + expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) + expect(page).to have_content(I18n.t('in_person_proofing.form.state_id.address1_hint')) + expect(page).to have_content(I18n.t('in_person_proofing.form.state_id.address2_hint')) + click_button t('forms.buttons.submit.update') + + # update address + click_button t('idv.buttons.change_address_label') + + expect(page).to have_content(t('in_person_proofing.headings.update_address')) + expect(page).to have_content(I18n.t('in_person_proofing.form.state_id.address1_hint')) + expect(page).to have_content(I18n.t('in_person_proofing.form.state_id.address2_hint')) end end - shared_examples 'captures address with state id' do + context 'same address as id is false', + allow_browser_log: true do let(:user) { user_with_2fa } before(:each) do - allow(IdentityConfig.store).to receive(:in_person_capture_secondary_id_enabled). - and_return(true) - sign_in_and_2fa_user(user) begin_in_person_proofing(user) complete_prepare_step(user) complete_location_step(user) end - it 'successfully proceeds through the flow' do - complete_state_id_step( - user, same_address_as_id: false, capture_secondary_id_enabled: true - ) - complete_address_step(user, double_address_verification: true) + it 'shows the address page' do + complete_state_id_step(user, same_address_as_id: false) + expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.verify_info')) + expect(page).to have_content(t('in_person_proofing.headings.address')) + + # arrive at address step + complete_address_step(user, same_address_as_id: false) + complete_ssn_step(user) # Ensure the page submitted successfully expect(page).to have_content(t('idv.form.ssn_label')) end - end - - context 'in_person_capture_secondary_id_enabled feature flag enabled', allow_browser_log: true do - context 'flag remains enabled' do - it_behaves_like 'captures address with state id' - end - - context 'flag is then disabled' do - before(:each) do - allow(IdentityConfig.store).to receive(:in_person_capture_secondary_id_enabled). - and_return(false) - end - it_behaves_like 'captures address with state id' + it 'can update the address page form' do + complete_state_id_step(user, same_address_as_id: false) + complete_address_step(user, same_address_as_id: false) + complete_ssn_step(user) + # click update address button on the verify page + click_button t('idv.buttons.change_address_label') + expect(page).to have_content(t('in_person_proofing.headings.update_address')) + fill_out_address_form_ok(same_address_as_id: true) + click_button t('forms.buttons.submit.update') + expect(page).to have_content(t('headings.verify')) + expect(page).to have_current_path(idv_in_person_verify_info_path) end end - context 'in_person_capture_secondary_id_enabled feature flag enabled and same address as id', + context 'same address as id is true then update is selected on verify info pg', allow_browser_log: true do let(:user) { user_with_2fa } before(:each) do - allow(IdentityConfig.store).to receive(:in_person_capture_secondary_id_enabled). - and_return(true) - sign_in_and_2fa_user(user) begin_in_person_proofing(user) complete_prepare_step(user) complete_location_step(user) end - it 'skips the address page' do - complete_state_id_step( - user, same_address_as_id: true, capture_secondary_id_enabled: true - ) - # skip address step - complete_ssn_step(user) - # Ensure the page submitted successfully - expect(page).to have_content(t('idv.form.ssn_label')) - end - - it 'can redo the address page form even if that page is skipped' do - complete_state_id_step( - user, same_address_as_id: true, capture_secondary_id_enabled: true - ) + it 'can redo the address page form after it is skipped' do + complete_state_id_step(user, same_address_as_id: true) # skip address step complete_ssn_step(user) # click update address button on the verify page click_button t('idv.buttons.change_address_label') expect(page).to have_content(t('in_person_proofing.headings.update_address')) - fill_out_address_form_ok(double_address_verification: true, same_address_as_id: true) + fill_out_address_form_ok(same_address_as_id: true) click_button t('forms.buttons.submit.update') expect(page).to have_content(t('headings.verify')) expect(page).to have_current_path(idv_in_person_verify_info_path) end it 'allows user to update their residential address as different from their state id' do - complete_state_id_step( - user, same_address_as_id: true, capture_secondary_id_enabled: true - ) + complete_state_id_step(user, same_address_as_id: true) complete_ssn_step(user) # click "update residential address" @@ -788,167 +652,155 @@ end end - context 'in_person_capture_secondary_id_enabled feature flag enabled and' do - context 'when updates are made on state ID page starting from Verify Your Information', - allow_browser_log: true do - let(:user) { user_with_2fa } - - before(:each) do - allow(IdentityConfig.store).to receive(:in_person_capture_secondary_id_enabled). - and_return(true) + context 'Updates are made on state ID page starting from Verify Your Information', + allow_browser_log: true do + let(:user) { user_with_2fa } - sign_in_and_2fa_user(user) - begin_in_person_proofing(user) - complete_prepare_step(user) - complete_location_step(user) - end + before(:each) do + sign_in_and_2fa_user(user) + begin_in_person_proofing(user) + complete_prepare_step(user) + complete_location_step(user) + end - it 'does not update their previous selection of "Yes, + it 'does not update their previous selection of "Yes, I live at the address on my state-issued ID"' do - complete_state_id_step( - user, same_address_as_id: true, capture_secondary_id_enabled: true - ) - # skip address step - complete_ssn_step(user) - # expect to be on verify page - expect(page).to have_content(t('headings.verify')) - expect(page).to have_current_path(idv_in_person_verify_info_path) - # click update state ID button on the verify page - click_button t('idv.buttons.change_state_id_label') - # expect to be on the state ID page - expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) - # change address - fill_in t('in_person_proofing.form.state_id.address1'), with: '' - fill_in t('in_person_proofing.form.state_id.address1'), with: 'test update address' - click_button t('forms.buttons.submit.update') - # expect to be back on verify page - expect(page).to have_content(t('headings.verify')) - expect(page).to have_current_path(idv_in_person_verify_info_path) - expect(page).to have_content(t('headings.verify')) - # expect to see state ID address update on verify twice - expect(page).to have_text('test update address').twice # for state id addr and addr update - # click update state id address - click_button t('idv.buttons.change_state_id_label') - # expect to be on the state ID page - expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) - # expect "Yes, I live at a different address" is checked" - expect(page).to have_checked_field( - t('in_person_proofing.form.state_id.same_address_as_id_yes'), - visible: false, - ) - end + complete_state_id_step(user, same_address_as_id: true) + # skip address step + complete_ssn_step(user) + # expect to be on verify page + expect(page).to have_content(t('headings.verify')) + expect(page).to have_current_path(idv_in_person_verify_info_path) + # click update state ID button on the verify page + click_button t('idv.buttons.change_state_id_label') + # expect to be on the state ID page + expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) + # change address + fill_in t('in_person_proofing.form.state_id.address1'), with: '' + fill_in t('in_person_proofing.form.state_id.address1'), with: 'test update address' + click_button t('forms.buttons.submit.update') + # expect to be back on verify page + expect(page).to have_content(t('headings.verify')) + expect(page).to have_current_path(idv_in_person_verify_info_path) + expect(page).to have_content(t('headings.verify')) + # expect to see state ID address update on verify twice + expect(page).to have_text('test update address').twice # for state id addr and addr update + # click update state id address + click_button t('idv.buttons.change_state_id_label') + # expect to be on the state ID page + expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) + # expect "Yes, I live at a different address" is checked" + expect(page).to have_checked_field( + t('in_person_proofing.form.state_id.same_address_as_id_yes'), + visible: false, + ) + end - it 'does not update their previous selection of "No, I live at a different address"' do - complete_state_id_step( - user, same_address_as_id: false, capture_secondary_id_enabled: true - ) - # expect to be on address page - expect(page).to have_content(t('in_person_proofing.headings.address')) - # complete address step - complete_address_step(user, double_address_verification: true) - complete_ssn_step(user) - # expect to be back on verify page - expect(page).to have_content(t('headings.verify')) - expect(page).to have_current_path(idv_in_person_verify_info_path) - # click update state ID button on the verify page - click_button t('idv.buttons.change_state_id_label') - # expect to be on the state ID page - expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) - # change address - fill_in t('in_person_proofing.form.state_id.address1'), with: '' - fill_in t('in_person_proofing.form.state_id.address1'), with: 'test update address' - click_button t('forms.buttons.submit.update') - # expect to be back on verify page - expect(page).to have_content(t('headings.verify')) - expect(page).to have_current_path(idv_in_person_verify_info_path) - expect(page).to have_content(t('headings.verify')) - # expect to see state ID address update on verify - expect(page).to have_text('test update address').once # only state id address update - # click update state id address - click_button t('idv.buttons.change_state_id_label') - # expect to be on the state ID page - expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) - expect(page).to have_checked_field( - t('in_person_proofing.form.state_id.same_address_as_id_no'), - visible: false, - ) - end + it 'does not update their previous selection of "No, I live at a different address"' do + complete_state_id_step(user, same_address_as_id: false) + # expect to be on address page + expect(page).to have_content(t('in_person_proofing.headings.address')) + # complete address step + complete_address_step(user) + complete_ssn_step(user) + # expect to be back on verify page + expect(page).to have_content(t('headings.verify')) + expect(page).to have_current_path(idv_in_person_verify_info_path) + # click update state ID button on the verify page + click_button t('idv.buttons.change_state_id_label') + # expect to be on the state ID page + expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) + # change address + fill_in t('in_person_proofing.form.state_id.address1'), with: '' + fill_in t('in_person_proofing.form.state_id.address1'), with: 'test update address' + click_button t('forms.buttons.submit.update') + # expect to be back on verify page + expect(page).to have_content(t('headings.verify')) + expect(page).to have_current_path(idv_in_person_verify_info_path) + expect(page).to have_content(t('headings.verify')) + # expect to see state ID address update on verify + expect(page).to have_text('test update address').once # only state id address update + # click update state id address + click_button t('idv.buttons.change_state_id_label') + # expect to be on the state ID page + expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) + expect(page).to have_checked_field( + t('in_person_proofing.form.state_id.same_address_as_id_no'), + visible: false, + ) + end - it 'updates their previous selection from "Yes" TO "No, I live at a different address"' do - complete_state_id_step( - user, same_address_as_id: true, capture_secondary_id_enabled: true - ) - # skip address step - complete_ssn_step(user) - # click update state ID button on the verify page - click_button t('idv.buttons.change_state_id_label') - # expect to be on the state ID page - expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) - # change address - fill_in t('in_person_proofing.form.state_id.address1'), with: '' - fill_in t('in_person_proofing.form.state_id.address1'), with: 'test update address' - # change response to No - choose t('in_person_proofing.form.state_id.same_address_as_id_no') - click_button t('forms.buttons.submit.update') - # expect to be on address page - expect(page).to have_content(t('in_person_proofing.headings.address')) - # complete address step - complete_address_step(user, double_address_verification: true) - # expect to be on verify page - expect(page).to have_content(t('headings.verify')) - expect(page).to have_current_path(idv_in_person_verify_info_path) - # expect to see state ID address update on verify - expect(page).to have_text('test update address').once # only state id address update - # click update state id address - click_button t('idv.buttons.change_state_id_label') - # expect to be on the state ID page - expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) - # check that the "No, I live at a different address" is checked" - expect(page).to have_checked_field( - t('in_person_proofing.form.state_id.same_address_as_id_no'), - visible: false, - ) - end + it 'updates their previous selection from "Yes" TO "No, I live at a different address"' do + complete_state_id_step(user, same_address_as_id: true) + # skip address step + complete_ssn_step(user) + # click update state ID button on the verify page + click_button t('idv.buttons.change_state_id_label') + # expect to be on the state ID page + expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) + # change address + fill_in t('in_person_proofing.form.state_id.address1'), with: '' + fill_in t('in_person_proofing.form.state_id.address1'), with: 'test update address' + # change response to No + choose t('in_person_proofing.form.state_id.same_address_as_id_no') + click_button t('forms.buttons.submit.update') + # expect to be on address page + expect(page).to have_content(t('in_person_proofing.headings.address')) + # complete address step + complete_address_step(user) + # expect to be on verify page + expect(page).to have_content(t('headings.verify')) + expect(page).to have_current_path(idv_in_person_verify_info_path) + # expect to see state ID address update on verify + expect(page).to have_text('test update address').once # only state id address update + # click update state id address + click_button t('idv.buttons.change_state_id_label') + # expect to be on the state ID page + expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) + # check that the "No, I live at a different address" is checked" + expect(page).to have_checked_field( + t('in_person_proofing.form.state_id.same_address_as_id_no'), + visible: false, + ) + end - it 'updates their previous selection from "No" TO "Yes, + it 'updates their previous selection from "No" TO "Yes, I live at the address on my state-issued ID"' do - complete_state_id_step( - user, same_address_as_id: false, capture_secondary_id_enabled: true - ) - # expect to be on address page - expect(page).to have_content(t('in_person_proofing.headings.address')) - # complete address step - complete_address_step(user, double_address_verification: true) - complete_ssn_step(user) - # expect to be on verify page - expect(page).to have_content(t('headings.verify')) - expect(page).to have_current_path(idv_in_person_verify_info_path) - # click update state ID button on the verify page - click_button t('idv.buttons.change_state_id_label') - # expect to be on the state ID page - expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) - # change address - fill_in t('in_person_proofing.form.state_id.address1'), with: '' - fill_in t('in_person_proofing.form.state_id.address1'), with: 'test update address' - # change response to Yes - choose t('in_person_proofing.form.state_id.same_address_as_id_yes') - click_button t('forms.buttons.submit.update') - # expect to be back on verify page - expect(page).to have_content(t('headings.verify')) - expect(page).to have_current_path(idv_in_person_verify_info_path) - # expect to see state ID address update on verify twice - expect(page).to have_text('test update address').twice # for state id addr and addr update - # click update state ID button on the verify page - click_button t('idv.buttons.change_state_id_label') - # expect to be on the state ID page - expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) - expect(page).to have_checked_field( - t('in_person_proofing.form.state_id.same_address_as_id_yes'), - visible: false, - ) - end + complete_state_id_step(user, same_address_as_id: false) + # expect to be on address page + expect(page).to have_content(t('in_person_proofing.headings.address')) + # complete address step + complete_address_step(user) + complete_ssn_step(user) + # expect to be on verify page + expect(page).to have_content(t('headings.verify')) + expect(page).to have_current_path(idv_in_person_verify_info_path) + # click update state ID button on the verify page + click_button t('idv.buttons.change_state_id_label') + # expect to be on the state ID page + expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) + # change address + fill_in t('in_person_proofing.form.state_id.address1'), with: '' + fill_in t('in_person_proofing.form.state_id.address1'), with: 'test update address' + # change response to Yes + choose t('in_person_proofing.form.state_id.same_address_as_id_yes') + click_button t('forms.buttons.submit.update') + # expect to be back on verify page + expect(page).to have_content(t('headings.verify')) + expect(page).to have_current_path(idv_in_person_verify_info_path) + # expect to see state ID address update on verify twice + expect(page).to have_text('test update address').twice # for state id addr and addr update + # click update state ID button on the verify page + click_button t('idv.buttons.change_state_id_label') + # expect to be on the state ID page + expect(page).to have_content(t('in_person_proofing.headings.update_state_id')) + expect(page).to have_checked_field( + t('in_person_proofing.form.state_id.same_address_as_id_yes'), + visible: false, + ) end end + context 'when manual address entry is enabled for post office search' do let(:user) { user_with_2fa } @@ -966,10 +818,10 @@ complete_location_step # state ID page - complete_state_id_step(user) + complete_state_id_step(user, same_address_as_id: false) # address page - complete_address_step(user) + complete_address_step(user, same_address_as_id: false) # ssn page select 'Reject', from: :mock_profiling_result @@ -983,6 +835,11 @@ expect(page).to have_text(InPersonHelper::GOOD_LAST_NAME) expect(page).to have_text(InPersonHelper::GOOD_DOB_FORMATTED_EVENT) expect(page).to have_text(InPersonHelper::GOOD_STATE_ID_NUMBER) + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ADDRESS1) + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ADDRESS2) + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_CITY) + expect(page).to have_text(Idp::Constants::MOCK_IDV_APPLICANT[:state_id_jurisdiction]).twice + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ZIPCODE) expect(page).to have_text(InPersonHelper::GOOD_ADDRESS1) expect(page).to have_text(InPersonHelper::GOOD_CITY) expect(page).to have_text(InPersonHelper::GOOD_ZIPCODE) diff --git a/spec/features/idv/steps/in_person/ssn_spec.rb b/spec/features/idv/steps/in_person/ssn_spec.rb index 011f4ed029e..31e35137481 100644 --- a/spec/features/idv/steps/in_person/ssn_spec.rb +++ b/spec/features/idv/steps/in_person/ssn_spec.rb @@ -6,7 +6,6 @@ before do allow(IdentityConfig.store).to receive(:in_person_proofing_enabled).and_return(true) - allow(IdentityConfig.store).to receive(:in_person_capture_secondary_id_enabled).and_return(true) end context 'when visiting ssn for the first time' do @@ -101,7 +100,7 @@ end end - context 'when in_person_capture_secondary_id_enabled is true, ssn step is accessible from' do + context 'when same_address_as_id is false, ssn step is accessible from' do it 'address step', allow_browser_log: true do user = user_with_2fa sign_in_and_2fa_user(user) @@ -111,25 +110,27 @@ # location page complete_location_step(user) # state ID page - fill_out_state_id_form_ok(same_address_as_id: false, capture_secondary_id_enabled: true) + fill_out_state_id_form_ok(same_address_as_id: false) click_idv_continue - fill_out_address_form_ok(double_address_verification: true, same_address_as_id: false) + fill_out_address_form_ok(same_address_as_id: false) click_idv_continue # ssn page expect(page).to have_content(t('doc_auth.headings.ssn')) end - it 'state_id step (when state id address matches residential address)', - allow_browser_log: true do - user = user_with_2fa - complete_idv_steps_before_ssn(user) - # ssn page - expect(page).to have_content(t('doc_auth.headings.ssn')) - end - it 'verify info step', allow_browser_log: true do user = user_with_2fa - complete_idv_steps_before_ssn(user) + sign_in_and_2fa_user(user) + begin_in_person_proofing(user) + # prepare page + complete_prepare_step(user) + # location page + complete_location_step(user) + # state ID page + fill_out_state_id_form_ok(same_address_as_id: false) + click_idv_continue + fill_out_address_form_ok(same_address_as_id: false) + click_idv_continue # ssn page (first visit) complete_ssn_step(user) # verify page (next page) diff --git a/spec/features/idv/steps/in_person/state_id_step_spec.rb b/spec/features/idv/steps/in_person/state_id_step_spec.rb index a265174d37f..aa774a0477a 100644 --- a/spec/features/idv/steps/in_person/state_id_step_spec.rb +++ b/spec/features/idv/steps/in_person/state_id_step_spec.rb @@ -8,36 +8,28 @@ allow(IdentityConfig.store).to receive(:in_person_proofing_enabled).and_return(true) end - context 'capture secondary id is enabled' do - before do - allow(IdentityConfig.store). - to(receive(:in_person_capture_secondary_id_enabled)). - and_return(true) - end + it 'validates zip code input', allow_browser_log: true do + user = user_with_2fa - it 'validates zip code input', allow_browser_log: true do - user = user_with_2fa - - sign_in_and_2fa_user(user) - begin_in_person_proofing(user) - complete_prepare_step(user) - complete_location_step(user) - expect(page).to have_current_path(idv_in_person_step_path(step: :state_id), wait: 10) - fill_out_state_id_form_ok(same_address_as_id: true, capture_secondary_id_enabled: true) - # blank out the zip code field - fill_in t('in_person_proofing.form.state_id.zipcode'), with: '' - # try to enter invalid input into the zip code field - fill_in t('in_person_proofing.form.state_id.zipcode'), with: 'invalid input' - expect(page).to have_field(t('in_person_proofing.form.state_id.zipcode'), with: '') - # enter valid characters, but invalid length - fill_in t('in_person_proofing.form.state_id.zipcode'), with: '123' - click_idv_continue - expect(page).to have_css('.usa-error-message', text: t('idv.errors.pattern_mismatch.zipcode')) - # enter a valid zip and make sure we can continue - fill_in t('in_person_proofing.form.state_id.zipcode'), with: '123456789' - expect(page).to have_field(t('in_person_proofing.form.state_id.zipcode'), with: '12345-6789') - click_idv_continue - expect(page).to have_current_path(idv_in_person_ssn_url) - end + sign_in_and_2fa_user(user) + begin_in_person_proofing(user) + complete_prepare_step(user) + complete_location_step(user) + expect(page).to have_current_path(idv_in_person_step_path(step: :state_id), wait: 10) + fill_out_state_id_form_ok(same_address_as_id: true) + # blank out the zip code field + fill_in t('in_person_proofing.form.state_id.zipcode'), with: '' + # try to enter invalid input into the zip code field + fill_in t('in_person_proofing.form.state_id.zipcode'), with: 'invalid input' + expect(page).to have_field(t('in_person_proofing.form.state_id.zipcode'), with: '') + # enter valid characters, but invalid length + fill_in t('in_person_proofing.form.state_id.zipcode'), with: '123' + click_idv_continue + expect(page).to have_css('.usa-error-message', text: t('idv.errors.pattern_mismatch.zipcode')) + # enter a valid zip and make sure we can continue + fill_in t('in_person_proofing.form.state_id.zipcode'), with: '123456789' + expect(page).to have_field(t('in_person_proofing.form.state_id.zipcode'), with: '12345-6789') + click_idv_continue + expect(page).to have_current_path(idv_in_person_ssn_url) end end diff --git a/spec/features/idv/steps/in_person/verify_info_spec.rb b/spec/features/idv/steps/in_person/verify_info_spec.rb index c4a4be66b56..f7172c6a70a 100644 --- a/spec/features/idv/steps/in_person/verify_info_spec.rb +++ b/spec/features/idv/steps/in_person/verify_info_spec.rb @@ -7,8 +7,7 @@ let(:user) { user_with_2fa } let(:fake_analytics) { FakeAnalytics.new(user: user) } - let(:capture_secondary_id_enabled) { false } - let(:enrollment) { InPersonEnrollment.new(capture_secondary_id_enabled:) } + let(:enrollment) { InPersonEnrollment.new } before do allow(IdentityConfig.store).to receive(:in_person_proofing_enabled).and_return(true) @@ -24,7 +23,6 @@ complete_prepare_step(user) complete_location_step(user) complete_state_id_step(user) - complete_address_step(user) complete_ssn_step(user) # verify page @@ -35,10 +33,11 @@ expect(page).to have_text(InPersonHelper::GOOD_LAST_NAME) expect(page).to have_text(InPersonHelper::GOOD_DOB_FORMATTED_EVENT) expect(page).to have_text(InPersonHelper::GOOD_STATE_ID_NUMBER) - expect(page).to have_text(InPersonHelper::GOOD_ADDRESS1) - expect(page).to have_text(InPersonHelper::GOOD_CITY) - expect(page).to have_text(InPersonHelper::GOOD_ZIPCODE) - expect(page).to have_text(Idp::Constants::MOCK_IDV_APPLICANT[:state]) + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ADDRESS1).twice + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ADDRESS2).twice + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_CITY).twice + expect(page).to have_text(Idp::Constants::MOCK_IDV_APPLICANT[:state_id_jurisdiction], count: 3) + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ZIPCODE).twice expect(page).to have_text(DocAuthHelper::GOOD_SSN_MASKED) # click update state ID button @@ -58,7 +57,7 @@ click_doc_auth_back_link expect(page).to have_content(t('headings.verify')) expect(page).to have_current_path(idv_in_person_verify_info_path) - expect(page).to have_text(InPersonHelper::GOOD_ADDRESS1) + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ADDRESS1) expect(page).not_to have_text('bad address') # click update ssn button @@ -83,7 +82,6 @@ complete_prepare_step(user) complete_location_step(user) complete_state_id_step(user) - complete_address_step(user) complete_ssn_step(user) # verify page @@ -95,10 +93,11 @@ expect(page).to have_text(InPersonHelper::GOOD_LAST_NAME) expect(page).to have_text(InPersonHelper::GOOD_DOB_FORMATTED_EVENT) expect(page).to have_text(InPersonHelper::GOOD_STATE_ID_NUMBER) - expect(page).to have_text(InPersonHelper::GOOD_ADDRESS1) - expect(page).to have_text(InPersonHelper::GOOD_CITY) - expect(page).to have_text(InPersonHelper::GOOD_ZIPCODE) - expect(page).to have_text(Idp::Constants::MOCK_IDV_APPLICANT[:state]) + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ADDRESS1).twice + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ADDRESS2).twice + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_CITY).twice + expect(page).to have_text(Idp::Constants::MOCK_IDV_APPLICANT[:state_id_jurisdiction], count: 3) + expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ZIPCODE).twice expect(page).to have_text(DocAuthHelper::GOOD_SSN_MASKED) # click update state ID button @@ -115,7 +114,6 @@ click_button t('idv.buttons.change_address_label') expect(page).to have_content(t('in_person_proofing.headings.update_address')) fill_in t('idv.form.address1'), with: '987 Fake St.' - choose t('in_person_proofing.form.address.same_address_choice_yes') click_button t('forms.buttons.submit.update') expect(page).to have_content(t('headings.verify')) expect(page).to have_current_path(idv_in_person_verify_info_path) @@ -145,7 +143,6 @@ complete_prepare_step(user) complete_location_step(user) complete_state_id_step(user) - complete_address_step(user) fill_out_ssn_form_with_ssn_that_fails_resolution click_idv_continue click_idv_continue @@ -163,7 +160,6 @@ complete_prepare_step(user) complete_location_step(user) complete_state_id_step(user) - complete_address_step(user) complete_ssn_step(user) click_idv_continue diff --git a/spec/forms/idv/in_person/address_form_spec.rb b/spec/forms/idv/in_person/address_form_spec.rb index f51daf033e3..fc6d284c5df 100644 --- a/spec/forms/idv/in_person/address_form_spec.rb +++ b/spec/forms/idv/in_person/address_form_spec.rb @@ -23,7 +23,7 @@ } end context 'when usps_ipp_transliteration_enabled is false' do - let(:subject) { described_class.new(capture_secondary_id_enabled: true) } + let(:subject) { described_class.new } before(:each) do allow(IdentityConfig.store).to receive(:usps_ipp_transliteration_enabled).and_return(false) end @@ -52,7 +52,7 @@ end end context 'when usps_ipp_transliteration_enabled is enabled ' do - let(:subject) { described_class.new(capture_secondary_id_enabled: true) } + let(:subject) { described_class.new } before(:each) do allow(IdentityConfig.store).to receive(:usps_ipp_transliteration_enabled).and_return(true) end @@ -77,26 +77,13 @@ before(:each) do allow(IdentityConfig.store).to receive(:usps_ipp_transliteration_enabled).and_return(true) end - context 'when capture_secondary_id_enabled is true' do - let(:subject) { described_class.new(capture_secondary_id_enabled: true) } - it 'submit with missing same_address_as_id should be successful' do - missing_required_params = good_params.except(:same_address_as_id) - result = subject.submit(missing_required_params) - expect(subject.errors.empty?).to be(true) - expect(result).to be_kind_of(FormResponse) - expect(result.success?).to be(true) - end - end - context 'when capture_secondary_id_enabled is false' do - let(:subject) { described_class.new(capture_secondary_id_enabled: false) } - it 'submit with missing same_address_as_id will fail' do - missing_required_params = good_params.except(:same_address_as_id) - result = subject.submit(missing_required_params) - expect(subject.errors.empty?).to be(false) - expect(result).to be_kind_of(FormResponse) - expect(result.success?).to be(false) - expect(result.errors.keys).to include(:same_address_as_id) - end + let(:subject) { described_class.new } + it 'submit with missing same_address_as_id should be successful' do + missing_required_params = good_params.except(:same_address_as_id) + result = subject.submit(missing_required_params) + expect(subject.errors.empty?).to be(true) + expect(result).to be_kind_of(FormResponse) + expect(result.success?).to be(true) end end end diff --git a/spec/forms/idv/state_id_form_spec.rb b/spec/forms/idv/state_id_form_spec.rb index a2d371c481d..7e2fadb21a5 100644 --- a/spec/forms/idv/state_id_form_spec.rb +++ b/spec/forms/idv/state_id_form_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' RSpec.describe Idv::StateIdForm do - let(:subject) { Idv::StateIdForm.new(pii, capture_secondary_id_enabled:) } + let(:subject) { Idv::StateIdForm.new(pii) } let(:valid_dob) do valid_d = Time.zone.today - IdentityConfig.store.idv_min_age_years.years - 1.day ActionController::Parameters.new( @@ -62,7 +62,6 @@ } end let(:pii) { nil } - let(:capture_secondary_id_enabled) { true } describe '#submit' do context 'when the form is valid' do it 'returns a successful form response' do diff --git a/spec/jobs/get_usps_proofing_results_job_spec.rb b/spec/jobs/get_usps_proofing_results_job_spec.rb index defb960d05f..8b517ec960d 100644 --- a/spec/jobs/get_usps_proofing_results_job_spec.rb +++ b/spec/jobs/get_usps_proofing_results_job_spec.rb @@ -218,7 +218,7 @@ describe '#perform' do describe 'IPP enabled' do - describe 'DAV not enabled' do + describe 'Proofed without secondary id' do let!(:pending_enrollments) do ['BALTIMORE', 'FRIENDSHIP', 'WASHINGTON', 'ARLINGTON', 'DEANWOOD'].map do |name| create( @@ -1149,19 +1149,17 @@ end end - describe 'DAV enabled' do - let(:capture_secondary_id_enabled) { true } + describe 'Proofed with secondary id' do let(:pending_enrollment) do create( - :in_person_enrollment, :pending, - capture_secondary_id_enabled: capture_secondary_id_enabled + :in_person_enrollment, :pending ) end before do allow(IdentityConfig.store).to receive(:in_person_proofing_enabled).and_return(true) end - context 'when an enrollment passes proofing with an secondary ID and DAV enabled' do + context 'when an enrollment passes proofing with a secondary ID' do before do stub_request_passed_proofing_secondary_id_type_results end @@ -1212,85 +1210,82 @@ ) end end + end - context 'sms notifications enabled' do - let(:pending_enrollment) do - create( - :in_person_enrollment, - :pending, - :with_notification_phone_configuration, - capture_secondary_id_enabled: true, - ) - end - - before do - allow(IdentityConfig.store).to receive(:in_person_send_proofing_notifications_enabled). - and_return(true) - end + describe 'sms notifications enabled' do + let(:pending_enrollment) do + create( + :in_person_enrollment, :pending, :with_notification_phone_configuration + ) + end + before do + allow(IdentityConfig.store).to receive(:in_person_proofing_enabled).and_return(true) + allow(IdentityConfig.store).to receive(:in_person_send_proofing_notifications_enabled). + and_return(true) + end - context 'enrollment is expired' do - it 'deletes the notification phone configuration without sending an sms' do - stub_request_expired_proofing_results + context 'enrollment is expired' do + it 'deletes the notification phone configuration without sending an sms' do + stub_request_expired_proofing_results - expect(pending_enrollment.notification_phone_configuration).to_not be_nil + expect(pending_enrollment.notification_phone_configuration).to_not be_nil - job.perform(Time.zone.now) + job.perform(Time.zone.now) - expect(pending_enrollment.reload.notification_phone_configuration).to be_nil - expect(pending_enrollment.notification_sent_at).to be_nil - end + expect(pending_enrollment.reload.notification_phone_configuration).to be_nil + expect(pending_enrollment.notification_sent_at).to be_nil end + end - context 'enrollment has passed proofing' do - it 'invokes the SendProofingNotificationJob for the enrollment' do - stub_request_passed_proofing_results + context 'enrollment has passed proofing' do + it 'invokes the SendProofingNotificationJob for the enrollment' do + stub_request_passed_proofing_results - expect(pending_enrollment.notification_phone_configuration).to_not be_nil - expect(pending_enrollment.notification_sent_at).to be_nil + expect(pending_enrollment.notification_phone_configuration).to_not be_nil + expect(pending_enrollment.notification_sent_at).to be_nil - expect { job.perform(Time.zone.now) }. - to have_enqueued_job(InPerson::SendProofingNotificationJob). - with(pending_enrollment.id) - end + expect { job.perform(Time.zone.now) }. + to have_enqueued_job(InPerson::SendProofingNotificationJob). + with(pending_enrollment.id) end + end - context 'enrollment has failed proofing' do - it 'invokes the SendProofingNotificationJob for the enrollment' do - stub_request_failed_proofing_results + context 'enrollment has failed proofing' do + it 'invokes the SendProofingNotificationJob for the enrollment' do + stub_request_failed_proofing_results - expect(pending_enrollment.notification_phone_configuration).to_not be_nil - expect(pending_enrollment.notification_sent_at).to be_nil + expect(pending_enrollment.notification_phone_configuration).to_not be_nil + expect(pending_enrollment.notification_sent_at).to be_nil - expect { job.perform(Time.zone.now) }. - to have_enqueued_job(InPerson::SendProofingNotificationJob). - with(pending_enrollment.id) - end + expect { job.perform(Time.zone.now) }. + to have_enqueued_job(InPerson::SendProofingNotificationJob). + with(pending_enrollment.id) end + end - context 'enrollment has failed proofing due to unsupported secondary ID' do - it 'invokes the SendProofingNotificationJob for the enrollment' do - stub_request_passed_proofing_secondary_id_type_results + context 'enrollment has failed proofing due to unsupported secondary ID' do + it 'invokes the SendProofingNotificationJob for the enrollment' do + stub_request_passed_proofing_secondary_id_type_results - expect(pending_enrollment.notification_phone_configuration).to_not be_nil - expect(pending_enrollment.notification_sent_at).to be_nil + expect(pending_enrollment.notification_phone_configuration).to_not be_nil + expect(pending_enrollment.notification_sent_at).to be_nil - expect { job.perform(Time.zone.now) }. - to have_enqueued_job(InPerson::SendProofingNotificationJob). - with(pending_enrollment.id) - end + expect { job.perform(Time.zone.now) }. + to have_enqueued_job(InPerson::SendProofingNotificationJob). + with(pending_enrollment.id) end + end - context 'enrollment has failed proofing due to unsupported ID type' do - it 'invokes the SendProofingNotificationJob for the enrollment' do - stub_request_passed_proofing_unsupported_id_results + context 'enrollment has failed proofing due to unsupported ID type' do + it 'invokes the SendProofingNotificationJob for the enrollment' do + stub_request_passed_proofing_unsupported_id_results - expect(pending_enrollment.notification_phone_configuration).to_not be_nil - expect(pending_enrollment.notification_sent_at).to be_nil + expect(pending_enrollment.notification_phone_configuration).to_not be_nil + expect(pending_enrollment.notification_sent_at).to be_nil - expect { job.perform(Time.zone.now) }. - to have_enqueued_job(InPerson::SendProofingNotificationJob). - with(pending_enrollment.id) - end + expect { job.perform(Time.zone.now) }. + to have_enqueued_job(InPerson::SendProofingNotificationJob). + with(pending_enrollment.id) end end end diff --git a/spec/jobs/resolution_proofing_job_spec.rb b/spec/jobs/resolution_proofing_job_spec.rb index 84fc0c97232..a581637b608 100644 --- a/spec/jobs/resolution_proofing_job_spec.rb +++ b/spec/jobs/resolution_proofing_job_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' RSpec.describe ResolutionProofingJob, type: :job do - let(:pii) { Idp::Constants::MOCK_IDV_APPLICANT_WITH_SSN } + let(:pii) { Idp::Constants::MOCK_IDV_APPLICANT_SAME_ADDRESS_AS_ID } let(:encrypted_arguments) do Encryption::Encryptors::BackgroundProofingArgEncryptor.new.encrypt( { applicant_pii: pii }.to_json, diff --git a/spec/mailers/previews/user_mailer_preview.rb b/spec/mailers/previews/user_mailer_preview.rb index 2da146b5174..a85d3df8ba1 100644 --- a/spec/mailers/previews/user_mailer_preview.rb +++ b/spec/mailers/previews/user_mailer_preview.rb @@ -234,7 +234,6 @@ def in_person_enrollment ), status_updated_at: Time.zone.now - 1.hour, current_address_matches_id: params['current_address_matches_id'] == 'true', - capture_secondary_id_enabled: IdentityConfig.store.in_person_capture_secondary_id_enabled, selected_location_details: { 'name' => 'BALTIMORE', 'street_address' => '900 E FAYETTE ST RM 118', diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb index 344f2db5be1..e78a78ef1c9 100644 --- a/spec/mailers/user_mailer_spec.rb +++ b/spec/mailers/user_mailer_spec.rb @@ -534,7 +534,6 @@ def expect_email_body_to_have_help_and_contact_links end context 'in person emails' do - let(:capture_secondary_id_enabled) { false } let(:current_address_matches_id) { false } let!(:enrollment) do create( @@ -542,7 +541,6 @@ def expect_email_body_to_have_help_and_contact_links :pending, selected_location_details: { name: 'FRIENDSHIP' }, status_updated_at: Time.zone.now - 2.hours, - capture_secondary_id_enabled: capture_secondary_id_enabled, current_address_matches_id: current_address_matches_id, ) end @@ -557,25 +555,6 @@ def expect_email_body_to_have_help_and_contact_links it_behaves_like 'a system email' it_behaves_like 'an email that respects user email locale preference' - context 'double address verification is not enabled' do - it 'renders the body' do - expect(mail.html_part.body). - to have_content( - t('in_person_proofing.process.proof_of_address.heading'), - ) - end - end - - context 'double address verification is enabled' do - let(:capture_secondary_id_enabled) { true } - it 'renders the body' do - expect(mail.html_part.body). - to_not have_content( - t('in_person_proofing.process.proof_of_address.heading'), - ) - end - end - context 'Outage message' do let(:formatted_date) { 'Tuesday, October 31' } let(:in_person_outage_emailed_by_date) { 'November 1, 2023' } @@ -646,25 +625,6 @@ def expect_email_body_to_have_help_and_contact_links it_behaves_like 'a system email' it_behaves_like 'an email that respects user email locale preference' - context 'double address verification is not enabled' do - it 'renders the body' do - expect(mail.html_part.body). - to have_content( - t('in_person_proofing.process.proof_of_address.heading'), - ) - end - end - - context 'double address verification is enabled' do - let(:capture_secondary_id_enabled) { true } - it 'renders the body' do - expect(mail.html_part.body). - to_not have_content( - t('in_person_proofing.process.proof_of_address.heading'), - ) - end - end - it 'renders the body' do expect(mail.html_part.body). to have_content( @@ -699,7 +659,6 @@ def expect_email_body_to_have_help_and_contact_links selected_location_details: { name: 'FRIENDSHIP' }, status_updated_at: Time.zone.now - 2.hours, current_address_matches_id: current_address_matches_id, - capture_secondary_id_enabled: capture_secondary_id_enabled, ) end @@ -711,25 +670,6 @@ def expect_email_body_to_have_help_and_contact_links it_behaves_like 'a system email' it_behaves_like 'an email that respects user email locale preference' - - context 'double address verification is not enabled' do - it 'renders the body' do - expect(mail.html_part.body). - to have_content( - t('user_mailer.in_person_failed.verifying_step_proof_of_address'), - ) - end - end - - context 'double address verification is enabled' do - let(:capture_secondary_id_enabled) { true } - it 'renders the body' do - expect(mail.html_part.body). - to_not have_content( - t('user_mailer.in_person_failed.verifying_step_proof_of_address'), - ) - end - end end describe '#in_person_failed_fraud' do diff --git a/spec/models/in_person_enrollment_spec.rb b/spec/models/in_person_enrollment_spec.rb index 35848e6d5ab..1d2bd5ac76b 100644 --- a/spec/models/in_person_enrollment_spec.rb +++ b/spec/models/in_person_enrollment_spec.rb @@ -144,34 +144,6 @@ expect(enrollment.unique_id).to eq('1234') end - - describe 'setting capture_secondary_id_enabled on creation' do - let(:capture_enabled) { nil } - - before do - allow(IdentityConfig.store). - to( - receive(:in_person_capture_secondary_id_enabled). - and_return(capture_enabled), - ) - end - - context 'feature flag is enabled' do - let(:capture_enabled) { true } - it 'sets capture_secondary_id_enabled to true on the enrollment' do - enrollment = create(:in_person_enrollment, :pending) - expect(enrollment.capture_secondary_id_enabled).to eq(true) - end - end - - context 'feature flag is not enabled' do - let(:capture_enabled) { false } - it 'does not set capture_secondary_id_enabled to true on the enrollment' do - enrollment = create(:in_person_enrollment, :pending) - expect(enrollment.capture_secondary_id_enabled).to eq(false) - end - end - end end describe 'enrollments that need email reminders' do diff --git a/spec/presenters/idv/in_person/ready_to_verify_presenter_spec.rb b/spec/presenters/idv/in_person/ready_to_verify_presenter_spec.rb index ee9db5e0668..4c66d801dae 100644 --- a/spec/presenters/idv/in_person/ready_to_verify_presenter_spec.rb +++ b/spec/presenters/idv/in_person/ready_to_verify_presenter_spec.rb @@ -11,7 +11,6 @@ let(:enrollment_selected_location_details) do JSON.parse(UspsInPersonProofing::Mock::Fixtures.enrollment_selected_location_details) end - let(:capture_secondary_id_enabled) { false } let(:enrollment) do create( :in_person_enrollment, :with_service_provider, :pending, @@ -20,8 +19,7 @@ created_at: created_at, enrollment_established_at: enrollment_established_at, current_address_matches_id: current_address_matches_id, - selected_location_details: enrollment_selected_location_details, - capture_secondary_id_enabled: capture_secondary_id_enabled + selected_location_details: enrollment_selected_location_details ) end subject(:presenter) { described_class.new(enrollment: enrollment) } @@ -102,42 +100,6 @@ end end - describe '#needs_proof_of_address?' do - subject(:needs_proof_of_address) { presenter.needs_proof_of_address? } - - context 'with double address verification disabled' do - let(:capture_secondary_id_enabled) { false } - - context 'with current address matching id' do - let(:current_address_matches_id) { true } - - it { expect(needs_proof_of_address).to eq false } - end - - context 'with current address not matching id' do - let(:current_address_matches_id) { false } - - it { expect(needs_proof_of_address).to eq true } - end - end - - context 'with double address verification enabled' do - let(:capture_secondary_id_enabled) { true } - - context 'with current address matching id' do - let(:current_address_matches_id) { true } - - it { expect(needs_proof_of_address).to eq false } - end - - context 'with current address not matching id' do - let(:current_address_matches_id) { false } - - it { expect(needs_proof_of_address).to eq false } - end - end - end - describe '#sp_name' do subject(:sp_name) { presenter.sp_name } diff --git a/spec/presenters/idv/in_person/verification_results_email_presenter_spec.rb b/spec/presenters/idv/in_person/verification_results_email_presenter_spec.rb index 05f241b5bb5..4b53c3ae6da 100644 --- a/spec/presenters/idv/in_person/verification_results_email_presenter_spec.rb +++ b/spec/presenters/idv/in_person/verification_results_email_presenter_spec.rb @@ -7,7 +7,6 @@ let(:status_updated_at) { described_class::USPS_SERVER_TIMEZONE.parse('2022-07-14T00:00:00Z') } let(:sp) { nil } let(:current_address_matches_id) { true } - let(:capture_secondary_id_enabled) { false } let(:enrollment) do create( :in_person_enrollment, @@ -15,7 +14,6 @@ service_provider: sp, selected_location_details: { name: location_name }, current_address_matches_id: current_address_matches_id, - capture_secondary_id_enabled: capture_secondary_id_enabled, ) end @@ -185,40 +183,4 @@ end end end - - describe '#needs_proof_of_address?' do - subject(:needs_proof_of_address) { presenter.needs_proof_of_address? } - - context 'with double address verification disabled' do - let(:capture_secondary_id_enabled) { false } - - context 'with current address matching id' do - let(:current_address_matches_id) { true } - - it { expect(needs_proof_of_address).to eq false } - end - - context 'with current address not matching id' do - let(:current_address_matches_id) { false } - - it { expect(needs_proof_of_address).to eq true } - end - end - - context 'with double address verification enabled' do - let(:capture_secondary_id_enabled) { true } - - context 'with current address matching id' do - let(:current_address_matches_id) { true } - - it { expect(needs_proof_of_address).to eq false } - end - - context 'with current address not matching id' do - let(:current_address_matches_id) { false } - - it { expect(needs_proof_of_address).to eq false } - end - end - end end diff --git a/spec/services/idv/steps/in_person/address_step_spec.rb b/spec/services/idv/steps/in_person/address_step_spec.rb index d635d33b526..7a3cf969a1f 100644 --- a/spec/services/idv/steps/in_person/address_step_spec.rb +++ b/spec/services/idv/steps/in_person/address_step_spec.rb @@ -5,8 +5,7 @@ let(:submitted_values) { {} } let(:pii_from_user) { flow.flow_session[:pii_from_user] } let(:params) { ActionController::Parameters.new({ in_person_address: submitted_values }) } - let(:capture_secondary_id_enabled) { false } - let(:enrollment) { InPersonEnrollment.new(capture_secondary_id_enabled:) } + let(:enrollment) { InPersonEnrollment.new } let(:user) { build(:user) } let(:service_provider) { create(:service_provider) } let(:controller) do @@ -35,10 +34,6 @@ end describe '#call' do - before do - allow(IdentityConfig.store).to receive(:in_person_capture_secondary_id_enabled). - and_return(false) - end context 'with values submitted' do let(:address1) { '1 FAKE RD' } let(:address2) { 'APT 1B' } @@ -63,67 +58,51 @@ end end - it 'sets values in flow session' do + it 'sets the values in flow session' do step.call + expect(flow.flow_session[:pii_from_user]).to include( address1:, address2:, city:, zipcode:, state:, - same_address_as_id:, ) end - context 'with secondary capture enabled' do - let(:capture_secondary_id_enabled) { true } - - it 'sets the values in flow session' do + context 'when initially entering the residential address' do + it 'leaves the "same_address_as_id" attr as false' do + flow.flow_session[:pii_from_user][:same_address_as_id] = 'false' step.call - expect(flow.flow_session[:pii_from_user]).to include( - address1:, - address2:, - city:, - zipcode:, - state:, - ) + expect(flow.flow_session[:pii_from_user][:same_address_as_id]).to eq('false') end + end - context 'when initially entering the residential address' do - it 'leaves the "same_address_as_id" attr as false' do - flow.flow_session[:pii_from_user][:same_address_as_id] = 'false' - step.call - - expect(flow.flow_session[:pii_from_user][:same_address_as_id]).to eq('false') - end + context 'when updating the residential address' do + before(:each) do + flow.flow_session[:pii_from_user][:address1] = '123 New Residential Ave' end - context 'when updating the residential address' do + context 'user previously selected that the residential address matched state ID' do before(:each) do - flow.flow_session[:pii_from_user][:address1] = '123 New Residential Ave' + flow.flow_session[:pii_from_user][:same_address_as_id] = 'true' end - context 'user previously selected that the residential address matched state ID' do - before(:each) do - flow.flow_session[:pii_from_user][:same_address_as_id] = 'true' - end - - it 'infers and sets the "same_address_as_id" in the flow session to false' do - step.call - expect(flow.flow_session[:pii_from_user][:same_address_as_id]).to eq('false') - end + it 'infers and sets the "same_address_as_id" in the flow session to false' do + step.call + expect(flow.flow_session[:pii_from_user][:same_address_as_id]).to eq('false') end + end - context 'user previously selected that the residential address did not match state ID' do - before(:each) do - flow.flow_session[:pii_from_user][:same_address_as_id] = 'false' - end + context 'user previously selected that the residential address did not match state ID' do + before(:each) do + flow.flow_session[:pii_from_user][:same_address_as_id] = 'false' + end - it 'leaves the "same_address_as_id" in the flow session as false' do - step.call - expect(flow.flow_session[:pii_from_user][:same_address_as_id]).to eq('false') - end + it 'leaves the "same_address_as_id" in the flow session as false' do + step.call + expect(flow.flow_session[:pii_from_user][:same_address_as_id]).to eq('false') end end end @@ -131,17 +110,10 @@ end describe '#analytics_submitted_event' do - it 'logs idv_in_person_proofing_address_submitted' do - expect(step.analytics_submitted_event).to be(:idv_in_person_proofing_address_submitted) - end - - context 'with secondary capture enabled' do - let(:capture_secondary_id_enabled) { true } - it 'logs idv_in_person_proofing_residential_address_submitted' do - expect(step.analytics_submitted_event).to be( - :idv_in_person_proofing_residential_address_submitted, - ) - end + it 'logs idv_in_person_proofing_residential_address_submitted' do + expect(step.analytics_submitted_event).to be( + :idv_in_person_proofing_residential_address_submitted, + ) end end @@ -173,20 +145,5 @@ ) end end - - it 'returns capture enabled = false' do - expect(step.extra_view_variables).to include( - capture_secondary_id_enabled: false, - ) - end - - context 'with secondary capture enabled' do - let(:capture_secondary_id_enabled) { true } - it 'returns capture enabled = true' do - expect(step.extra_view_variables).to include( - capture_secondary_id_enabled: true, - ) - end - end end end diff --git a/spec/services/idv/steps/in_person/state_id_step_spec.rb b/spec/services/idv/steps/in_person/state_id_step_spec.rb index c9a279529b1..270a32b6117 100644 --- a/spec/services/idv/steps/in_person/state_id_step_spec.rb +++ b/spec/services/idv/steps/in_person/state_id_step_spec.rb @@ -5,8 +5,7 @@ let(:submitted_values) { {} } let(:params) { ActionController::Parameters.new({ state_id: submitted_values }) } let(:user) { build(:user) } - let(:capture_secondary_id_enabled) { false } - let(:enrollment) { InPersonEnrollment.new(capture_secondary_id_enabled:) } + let(:enrollment) { InPersonEnrollment.new } let(:service_provider) { create(:service_provider) } let(:controller) do instance_double( @@ -44,8 +43,6 @@ end before do - allow(IdentityConfig.store).to receive(:in_person_capture_secondary_id_enabled). - and_return(false) allow(user).to receive(:establishing_in_person_enrollment). and_return(enrollment) end @@ -84,10 +81,9 @@ end end - context 'when capture_secondary_id_enabled is...' do + context 'when same_address_as_id is...' do let(:pii_from_user) { flow.flow_session[:pii_from_user] } let(:params) { ActionController::Parameters.new({ state_id: submitted_values }) } - let(:capture_secondary_id_enabled) { true } let(:dob) { InPersonHelper::GOOD_DOB } # residential let(:address1) { InPersonHelper::GOOD_ADDRESS1 } @@ -107,8 +103,7 @@ and_return(enrollment) end - context 'enabled, and - same_address_as_id changed from "true" to "false"' do + context 'changed from "true" to "false"' do let(:submitted_values) do { dob:, @@ -125,6 +120,7 @@ identity_doc_zipcode:, } end + it 'marks address step as incomplete, retains identity_doc_ attrs/value but removes addr attr in flow session' do Idv::StateIdForm::ATTRIBUTES.each do |attr| @@ -161,8 +157,7 @@ end end - context 'enabled, and - same_address_as_id changed from "false" to "true"' do + context 'changed from "false" to "true"' do let(:submitted_values) do { dob:, @@ -200,8 +195,7 @@ end end - context 'enabled, and - same_address_as_id does not change from from "false"' do + context 'not changed from "false"' do let(:submitted_values) do { dob:, @@ -252,47 +246,6 @@ expect(pii_from_user[:zipcode]).to_not eq identity_doc_zipcode end end - - context 'not enabled' do - let(:capture_secondary_id_enabled) { false } - let(:submitted_values) do - { - dob:, - address1:, - address2:, - city:, - state:, - zipcode:, - identity_doc_address1:, - identity_doc_address2:, - identity_doc_city:, - identity_doc_address_state:, - identity_doc_zipcode:, - } - end - - it 'retains identity_doc_ attr/values in flow session' do - Idv::StateIdForm::ATTRIBUTES.each do |attr| - expect(flow.flow_session[:pii_from_user]).to_not have_key attr - end - - pii_from_user[:identity_doc_address1] = identity_doc_address1 - pii_from_user[:identity_doc_address2] = identity_doc_address2 - pii_from_user[:identity_doc_city] = identity_doc_city - pii_from_user[:identity_doc_address_state] = identity_doc_address_state - pii_from_user[:identity_doc_zipcode] = identity_doc_zipcode - - step.call - - expect(flow.flow_session[:pii_from_user]).to include( - identity_doc_address1:, - identity_doc_address2:, - identity_doc_city:, - identity_doc_address_state:, - identity_doc_zipcode:, - ) - end - end end end @@ -301,8 +254,7 @@ let(:first_name) { 'First name' } let(:pii_from_user) { flow.flow_session[:pii_from_user] } let(:params) { ActionController::Parameters.new } - let(:capture_secondary_id_enabled) { true } - let(:enrollment) { InPersonEnrollment.new(capture_secondary_id_enabled:) } + let(:enrollment) { InPersonEnrollment.new } before(:each) do allow(step).to receive(:current_user). @@ -354,30 +306,12 @@ ) end end - - context 'with secondary capture enabled' do - it 'returns capture enabled = true' do - expect(step.extra_view_variables).to include( - capture_secondary_id_enabled: true, - ) - end - end - - context 'with secondary capture disabled' do - let(:capture_secondary_id_enabled) { false } - it 'returns capture enabled = false' do - expect(step.extra_view_variables).to include( - capture_secondary_id_enabled: false, - ) - end - end end describe 'skip address step?' do let(:pii_from_user) { flow.flow_session[:pii_from_user] } let(:params) { ActionController::Parameters.new({ state_id: submitted_values }) } - let(:capture_secondary_id_enabled) { true } - let(:enrollment) { InPersonEnrollment.new(capture_secondary_id_enabled:) } + let(:enrollment) { InPersonEnrollment.new } let(:dob) { '1980-01-01' } let(:identity_doc_address_state) { 'Nevada' } let(:identity_doc_city) { 'Twin Peaks' } @@ -437,19 +371,5 @@ expect(pii_from_user[:zipcode]).to_not eq identity_doc_zipcode end end - - context 'capture secondary id is disabled' do - let(:capture_secondary_id_enabled) { false } - it 'does not add state id values to address values in pii' do - step.call - - pii_from_user = flow.flow_session[:pii_from_user] - expect(pii_from_user[:address1]).to_not eq identity_doc_address1 - expect(pii_from_user[:address2]).to_not eq identity_doc_address2 - expect(pii_from_user[:city]).to_not eq identity_doc_city - expect(pii_from_user[:state]).to_not eq identity_doc_address_state - expect(pii_from_user[:zipcode]).to_not eq identity_doc_zipcode - end - end end end diff --git a/spec/services/proofing/resolution/progressive_proofer_spec.rb b/spec/services/proofing/resolution/progressive_proofer_spec.rb index 58e9624c7e1..374292918b8 100644 --- a/spec/services/proofing/resolution/progressive_proofer_spec.rb +++ b/spec/services/proofing/resolution/progressive_proofer_spec.rb @@ -3,7 +3,7 @@ RSpec.describe Proofing::Resolution::ProgressiveProofer do let(:applicant_pii) { Idp::Constants::MOCK_IDV_APPLICANT_STATE_ID_ADDRESS } let(:should_proof_state_id) { true } - let(:double_address_verification) { false } + let(:double_address_verification) { true } let(:request_ip) { Faker::Internet.ip_v4_address } let(:threatmetrix_session_id) { SecureRandom.uuid } let(:timer) { JobHelpers::Timer.new } @@ -55,57 +55,33 @@ expect(proofing_result.same_address_as_id).to eq(applicant_pii[:same_address_as_id]) end - context 'when double address verification is enabled' do - let(:double_address_verification) { true } - let(:resolution_result) do - instance_double(Proofing::Resolution::Result) + let(:resolution_result) do + instance_double(Proofing::Resolution::Result) + end + context 'ThreatMetrix is enabled' do + let(:threatmetrix_proofer) { instance_double(Proofing::LexisNexis::Ddp::Proofer) } + + before do + allow(FeatureManagement).to receive(:proofing_device_profiling_collecting_enabled?). + and_return(true) + allow(IdentityConfig.store).to receive(:lexisnexis_threatmetrix_mock_enabled). + and_return(false) + allow(instance).to receive(:lexisnexis_ddp_proofer).and_return(threatmetrix_proofer) + + allow(instance).to receive(:proof_id_address_with_lexis_nexis_if_needed). + and_return(resolution_result) + allow(resolution_result).to receive(:success?).and_return(true) + allow(instant_verify_proofer).to receive(:proof) end - context 'ThreatMetrix is enabled' do - let(:threatmetrix_proofer) { instance_double(Proofing::LexisNexis::Ddp::Proofer) } - - before do - allow(FeatureManagement).to receive(:proofing_device_profiling_collecting_enabled?). - and_return(true) - allow(IdentityConfig.store).to receive(:lexisnexis_threatmetrix_mock_enabled). - and_return(false) - allow(instance).to receive(:lexisnexis_ddp_proofer).and_return(threatmetrix_proofer) - - allow(instance).to receive(:proof_id_address_with_lexis_nexis_if_needed). - and_return(resolution_result) - allow(resolution_result).to receive(:success?).and_return(true) - allow(instant_verify_proofer).to receive(:proof) - end - - it 'makes a request to the ThreatMetrix proofer' do - expect(threatmetrix_proofer).to receive(:proof) - subject - end - - context 'it lacks a session id' do - let(:threatmetrix_session_id) { nil } - it 'returns a disabled result' do - result = subject + it 'makes a request to the ThreatMetrix proofer' do + expect(threatmetrix_proofer).to receive(:proof) - device_profiling_result = result.device_profiling_result - - expect(device_profiling_result.success).to be(true) - expect(device_profiling_result.client).to eq('tmx_disabled') - expect(device_profiling_result.review_status).to eq('pass') - end - end + subject end - context 'ThreatMetrix is disabled' do - before do - allow(FeatureManagement).to receive(:proofing_device_profiling_collecting_enabled?). - and_return(false) - - allow(instance).to receive(:proof_id_address_with_lexis_nexis_if_needed). - and_return(resolution_result) - allow(resolution_result).to receive(:success?).and_return(true) - allow(instant_verify_proofer).to receive(:proof) - end + context 'it lacks a session id' do + let(:threatmetrix_session_id) { nil } it 'returns a disabled result' do result = subject @@ -116,155 +92,177 @@ expect(device_profiling_result.review_status).to eq('pass') end end + end - context 'residential address and id address are the same' do - let(:applicant_pii) { Idp::Constants::MOCK_IDV_APPLICANT_SAME_ADDRESS_AS_ID } - let(:aamva_proofer) { instance_double(Proofing::Aamva::Proofer) } - let(:residential_instant_verify_proof) do + context 'ThreatMetrix is disabled' do + before do + allow(FeatureManagement).to receive(:proofing_device_profiling_collecting_enabled?). + and_return(false) + + allow(instance).to receive(:proof_id_address_with_lexis_nexis_if_needed). + and_return(resolution_result) + allow(resolution_result).to receive(:success?).and_return(true) + allow(instant_verify_proofer).to receive(:proof) + end + it 'returns a disabled result' do + result = subject + + device_profiling_result = result.device_profiling_result + + expect(device_profiling_result.success).to be(true) + expect(device_profiling_result.client).to eq('tmx_disabled') + expect(device_profiling_result.review_status).to eq('pass') + end + end + + context 'residential address and id address are the same' do + let(:applicant_pii) { Idp::Constants::MOCK_IDV_APPLICANT_SAME_ADDRESS_AS_ID } + let(:aamva_proofer) { instance_double(Proofing::Aamva::Proofer) } + let(:residential_instant_verify_proof) do + instance_double(Proofing::Resolution::Result) + end + before do + allow(instance).to receive(:state_id_proofer).and_return(aamva_proofer) + allow(instance).to receive(:resolution_proofer).and_return(instant_verify_proofer) + allow(instant_verify_proofer).to receive(:proof). + and_return(residential_instant_verify_proof) + allow(residential_instant_verify_proof).to receive(:success?).and_return(true) + end + + it 'only makes one request to LexisNexis InstantVerify' do + expect(instant_verify_proofer).to receive(:proof).exactly(:once) + expect(aamva_proofer).to receive(:proof) + + subject + end + + it 'produces a result adjudicator with correct information' do + expect(aamva_proofer).to receive(:proof) + + result = subject + + expect(result.same_address_as_id).to eq('true') + expect(result.double_address_verification).to eq(true) + expect(result.resolution_result).to eq(result.residential_resolution_result) + end + + context 'LexisNexis InstantVerify fails' do + let(:result_that_failed_instant_verify) do instance_double(Proofing::Resolution::Result) end before do - allow(instance).to receive(:state_id_proofer).and_return(aamva_proofer) - allow(instance).to receive(:resolution_proofer).and_return(instant_verify_proofer) - allow(instant_verify_proofer).to receive(:proof). - and_return(residential_instant_verify_proof) - allow(residential_instant_verify_proof).to receive(:success?).and_return(true) + allow(instance).to receive(:proof_id_address_with_lexis_nexis_if_needed). + and_return(result_that_failed_instant_verify) + allow(instant_verify_proofer).to receive(:proof).with(hash_including(state_id_address)). + and_return(result_that_failed_instant_verify) + allow(instance).to receive(:user_can_pass_after_state_id_check?). + with(result_that_failed_instant_verify). + and_return(true) + allow(result_that_failed_instant_verify).to receive(:success?). + and_return(false) end - it 'only makes one request to LexisNexis InstantVerify' do - expect(instant_verify_proofer).to receive(:proof).exactly(:once) - expect(aamva_proofer).to receive(:proof) + context 'the failure can be covered by AAMVA' do + before do + allow(result_that_failed_instant_verify). + to receive(:attributes_requiring_additional_verification). + and_return([:address]) + end - subject - end + context 'it is not covered by AAMVA' do + let(:failed_aamva_proof) { instance_double(Proofing::StateIdResult) } + before do + allow(aamva_proofer).to receive(:proof).and_return(failed_aamva_proof) + allow(failed_aamva_proof).to receive(:verified_attributes).and_return([]) + allow(failed_aamva_proof).to receive(:success?).and_return(false) + end + it 'indicates the aamva check did not pass' do + result = subject - it 'produces a result adjudicator with correct information' do - expect(aamva_proofer).to receive(:proof) + expect(result.state_id_result.success?).to eq(false) + end + end - result = subject + context 'it is covered by AAMVA' do + let(:successful_aamva_proof) { instance_double(Proofing::StateIdResult) } + before do + allow(aamva_proofer).to receive(:proof).and_return(successful_aamva_proof) + allow(successful_aamva_proof).to receive(:verified_attributes). + and_return([:address]) + allow(successful_aamva_proof).to receive(:success?).and_return(true) + end + it 'indicates aamva did pass' do + result = subject - expect(result.same_address_as_id).to eq('true') - expect(result.double_address_verification).to eq(true) - expect(result.resolution_result).to eq(result.residential_resolution_result) + expect(result.state_id_result.success?).to eq(true) + end + end end + end - context 'LexisNexis InstantVerify fails' do - let(:result_that_failed_instant_verify) do + context 'LexisNexis InstantVerify passes for residential address and id address' do + context 'should proof with AAMVA' do + let(:id_resolution_that_passed_instant_verify) do instance_double(Proofing::Resolution::Result) end + let(:residential_resolution_that_passed_instant_verify) do + instance_double(Proofing::Resolution::Result) + end + before do + allow(instance).to receive(:proof_residential_address_if_needed). + and_return(residential_resolution_that_passed_instant_verify) allow(instance).to receive(:proof_id_address_with_lexis_nexis_if_needed). - and_return(result_that_failed_instant_verify) - allow(instant_verify_proofer).to receive(:proof).with(hash_including(state_id_address)). - and_return(result_that_failed_instant_verify) + and_return(id_resolution_that_passed_instant_verify) + allow(instant_verify_proofer).to receive(:proof). + with(hash_including(state_id_address)). + and_return(id_resolution_that_passed_instant_verify) allow(instance).to receive(:user_can_pass_after_state_id_check?). - with(result_that_failed_instant_verify). + with(id_resolution_that_passed_instant_verify). + and_return(true) + allow(id_resolution_that_passed_instant_verify).to receive(:success?). + and_return(true) + allow(residential_resolution_that_passed_instant_verify).to receive(:success?). and_return(true) - allow(result_that_failed_instant_verify).to receive(:success?). - and_return(false) end - context 'the failure can be covered by AAMVA' do - before do - allow(result_that_failed_instant_verify). - to receive(:attributes_requiring_additional_verification). - and_return([:address]) - end - - context 'it is not covered by AAMVA' do - let(:failed_aamva_proof) { instance_double(Proofing::StateIdResult) } - before do - allow(aamva_proofer).to receive(:proof).and_return(failed_aamva_proof) - allow(failed_aamva_proof).to receive(:verified_attributes).and_return([]) - allow(failed_aamva_proof).to receive(:success?).and_return(false) - end - it 'indicates the aamva check did not pass' do - result = subject - - expect(result.state_id_result.success?).to eq(false) - end - end + it 'makes a request to the AAMVA proofer' do + expect(aamva_proofer).to receive(:proof) - context 'it is covered by AAMVA' do - let(:successful_aamva_proof) { instance_double(Proofing::StateIdResult) } - before do - allow(aamva_proofer).to receive(:proof).and_return(successful_aamva_proof) - allow(successful_aamva_proof).to receive(:verified_attributes). - and_return([:address]) - allow(successful_aamva_proof).to receive(:success?).and_return(true) - end - it 'indicates aamva did pass' do - result = subject - - expect(result.state_id_result.success?).to eq(true) - end - end + subject end - end - context 'LexisNexis InstantVerify passes for residential address and id address' do - context 'should proof with AAMVA' do - let(:id_resolution_that_passed_instant_verify) do - instance_double(Proofing::Resolution::Result) - end - let(:residential_resolution_that_passed_instant_verify) do - instance_double(Proofing::Resolution::Result) + context 'AAMVA proofing fails' do + let(:aamva_client) { instance_double(Proofing::Aamva::VerificationClient) } + let(:failed_aamva_proof) do + instance_double(Proofing::StateIdResult) end - before do - allow(instance).to receive(:proof_residential_address_if_needed). - and_return(residential_resolution_that_passed_instant_verify) - allow(instance).to receive(:proof_id_address_with_lexis_nexis_if_needed). - and_return(id_resolution_that_passed_instant_verify) - allow(instant_verify_proofer).to receive(:proof). - with(hash_including(state_id_address)). - and_return(id_resolution_that_passed_instant_verify) - allow(instance).to receive(:user_can_pass_after_state_id_check?). - with(id_resolution_that_passed_instant_verify). - and_return(true) - allow(id_resolution_that_passed_instant_verify).to receive(:success?). - and_return(true) - allow(residential_resolution_that_passed_instant_verify).to receive(:success?). - and_return(true) + allow(Proofing::Aamva::VerificationClient).to receive(:new).and_return(aamva_client) + allow(failed_aamva_proof).to receive(:success?).and_return(false) end + it 'returns a result adjudicator that indicates the aamva proofing failed' do + allow(aamva_proofer).to receive(:proof).and_return(failed_aamva_proof) - it 'makes a request to the AAMVA proofer' do - expect(aamva_proofer).to receive(:proof) - - subject - end + result = subject - context 'AAMVA proofing fails' do - let(:aamva_client) { instance_double(Proofing::Aamva::VerificationClient) } - let(:failed_aamva_proof) do - instance_double(Proofing::StateIdResult) - end - before do - allow(Proofing::Aamva::VerificationClient).to receive(:new).and_return(aamva_client) - allow(failed_aamva_proof).to receive(:success?).and_return(false) - end - it 'returns a result adjudicator that indicates the aamva proofing failed' do - allow(aamva_proofer).to receive(:proof).and_return(failed_aamva_proof) - - result = subject - - expect(result.state_id_result.success?).to eq(false) - end + expect(result.state_id_result.success?).to eq(false) end end end end + end - context 'residential address and id address are different' do - let(:residential_address_proof) do - instance_double(Proofing::Resolution::Result) - end - let(:resolution_result) do - instance_double(Proofing::Resolution::Result) - end - let(:double_address_verification) { true } - let(:applicant_pii) do - JSON.parse(<<-STR, symbolize_names: true) + context 'residential address and id address are different' do + let(:residential_address_proof) do + instance_double(Proofing::Resolution::Result) + end + let(:resolution_result) do + instance_double(Proofing::Resolution::Result) + end + let(:double_address_verification) { true } + let(:applicant_pii) do + JSON.parse(<<-STR, symbolize_names: true) { "uuid": "3e8db152-4d35-4207-b828-3eee8c52c50f", "middle_name": "", @@ -291,164 +289,130 @@ "state_id_type": "drivers_license", "uuid_prefix": null } - STR - end - let(:residential_address) do - { - address1: applicant_pii[:address1], - address2: applicant_pii[:address2], - city: applicant_pii[:city], - state: applicant_pii[:state], - state_id_jurisdiction: applicant_pii[:state_id_jurisdiction], - zipcode: applicant_pii[:zipcode], - } - end - let(:state_id_address) do - { - address1: applicant_pii[:identity_doc_address1], - address2: applicant_pii[:identity_doc_address2], - city: applicant_pii[:identity_doc_city], - state: applicant_pii[:identity_doc_address_state], - state_id_jurisdiction: applicant_pii[:state_id_jurisdiction], - zipcode: applicant_pii[:identity_doc_zipcode], - } - end - - context 'LexisNexis InstantVerify passes for residential address' do - before do - allow(instance).to receive(:resolution_proofer).and_return(instant_verify_proofer) - allow(instant_verify_proofer).to receive(:proof).and_return(residential_address_proof) - allow(residential_address_proof).to receive(:success?).and_return(true) - end - context 'LexisNexis InstantVerify passes for id address' do - it 'makes two requests to the InstantVerify Proofer' do - expect(instant_verify_proofer).to receive(:proof). - with(hash_including(residential_address)). - ordered - expect(instant_verify_proofer).to receive(:proof). - with(hash_including(state_id_address)). - ordered - - subject - end + STR + end + let(:residential_address) do + { + address1: applicant_pii[:address1], + address2: applicant_pii[:address2], + city: applicant_pii[:city], + state: applicant_pii[:state], + state_id_jurisdiction: applicant_pii[:state_id_jurisdiction], + zipcode: applicant_pii[:zipcode], + } + end + let(:state_id_address) do + { + address1: applicant_pii[:identity_doc_address1], + address2: applicant_pii[:identity_doc_address2], + city: applicant_pii[:identity_doc_city], + state: applicant_pii[:identity_doc_address_state], + state_id_jurisdiction: applicant_pii[:state_id_jurisdiction], + zipcode: applicant_pii[:identity_doc_zipcode], + } + end - context 'AAMVA fails' do - let(:failed_aamva_proof) { instance_double(Proofing::StateIdResult) } - let(:aamva_proofer) { instance_double(Proofing::Aamva::Proofer) } - before do - allow(instance).to receive(:proof_id_with_aamva_if_needed). - and_return(failed_aamva_proof) - allow(aamva_proofer).to receive(:proof).and_return(failed_aamva_proof) - allow(failed_aamva_proof).to receive(:success?).and_return(false) - allow(resolution_result).to receive(:errors) - end - - it 'returns the correct resolution results' do - result_adjudicator = subject - - expect(result_adjudicator.residential_resolution_result.success?).to be(true) - expect(result_adjudicator.resolution_result.success?).to be(true) - expect(result_adjudicator.state_id_result.success?).to be(false) - end - end - end + context 'LexisNexis InstantVerify passes for residential address' do + before do + allow(instance).to receive(:resolution_proofer).and_return(instant_verify_proofer) + allow(instant_verify_proofer).to receive(:proof).and_return(residential_address_proof) + allow(residential_address_proof).to receive(:success?).and_return(true) end - context 'LexisNexis InstantVerify fails for residential address' do - let(:aamva_proofer) { instance_double(Proofing::Aamva::Proofer) } - - before do - allow(instance).to receive(:state_id_proofer).and_return(aamva_proofer) - allow(instance).to receive(:proof_residential_address_if_needed). - and_return(residential_address_proof) - allow(instant_verify_proofer).to receive(:proof). + context 'LexisNexis InstantVerify passes for id address' do + it 'makes two requests to the InstantVerify Proofer' do + expect(instant_verify_proofer).to receive(:proof). with(hash_including(residential_address)). - and_return(residential_address_proof) - allow(instance).to receive(:user_can_pass_after_state_id_check?). - with(residential_address_proof). - and_return(false) - allow(residential_address_proof).to receive(:success?). - and_return(false) - end - - it 'does not make unnecessary calls' do - expect(aamva_proofer).to_not receive(:proof) - expect(instant_verify_proofer).to_not receive(:proof). - with(hash_including(state_id_address)) + ordered + expect(instant_verify_proofer).to receive(:proof). + with(hash_including(state_id_address)). + ordered subject end - end - - context 'LexisNexis InstantVerify fails for id address & passes for residential address' do - let(:aamva_proofer) { instance_double(Proofing::Aamva::Proofer) } - let(:result_that_failed_instant_verify) do - instance_double(Proofing::Resolution::Result) - end - - before do - allow(instance).to receive(:state_id_proofer).and_return(aamva_proofer) - allow(instance).to receive(:proof_id_address_with_lexis_nexis_if_needed). - and_return(result_that_failed_instant_verify) - allow(instant_verify_proofer).to receive(:proof).with(hash_including(state_id_address)). - and_return(result_that_failed_instant_verify) - end - context 'the failure can be covered by AAMVA' do + context 'AAMVA fails' do let(:failed_aamva_proof) { instance_double(Proofing::StateIdResult) } let(:aamva_proofer) { instance_double(Proofing::Aamva::Proofer) } before do - allow(instance).to receive(:resolution_proofer).and_return(instant_verify_proofer) - allow(instant_verify_proofer).to receive(:proof).and_return(residential_address_proof) - allow(residential_address_proof).to receive(:success?).and_return(true) - - allow(instance).to receive(:user_can_pass_after_state_id_check?). - with(result_that_failed_instant_verify). - and_return(true) - allow(result_that_failed_instant_verify). - to receive(:attributes_requiring_additional_verification). - and_return([:address]) - allow(instance).to receive(:state_id_proofer).and_return(aamva_proofer) + allow(instance).to receive(:proof_id_with_aamva_if_needed). + and_return(failed_aamva_proof) + allow(aamva_proofer).to receive(:proof).and_return(failed_aamva_proof) + allow(failed_aamva_proof).to receive(:success?).and_return(false) + allow(resolution_result).to receive(:errors) end - it 'calls AAMVA' do - expect(aamva_proofer).to receive(:proof) - subject + it 'returns the correct resolution results' do + result_adjudicator = subject + + expect(result_adjudicator.residential_resolution_result.success?).to be(true) + expect(result_adjudicator.resolution_result.success?).to be(true) + expect(result_adjudicator.state_id_result.success?).to be(false) end end end end - end + context 'LexisNexis InstantVerify fails for residential address' do + let(:aamva_proofer) { instance_double(Proofing::Aamva::Proofer) } - context 'when double address verification is not enabled' do - let(:double_address_verification) { false } - let(:applicant_pii) do - # test ensures same_address_as_id value has no effect - Idp::Constants::MOCK_IDV_APPLICANT.merge(same_address_as_id: 'true') - end - let(:residential_instant_verify_proof) do - instance_double(Proofing::Resolution::Result) + before do + allow(instance).to receive(:state_id_proofer).and_return(aamva_proofer) + allow(instance).to receive(:proof_residential_address_if_needed). + and_return(residential_address_proof) + allow(instant_verify_proofer).to receive(:proof). + with(hash_including(residential_address)). + and_return(residential_address_proof) + allow(instance).to receive(:user_can_pass_after_state_id_check?). + with(residential_address_proof). + and_return(false) + allow(residential_address_proof).to receive(:success?). + and_return(false) + end + + it 'does not make unnecessary calls' do + expect(aamva_proofer).to_not receive(:proof) + expect(instant_verify_proofer).to_not receive(:proof). + with(hash_including(state_id_address)) + + subject + end end - it 'makes one request to LexisNexis InstantVerify' do - allow(instance).to receive(:resolution_proofer).and_return(instant_verify_proofer) - allow(instant_verify_proofer).to receive(:proof). - and_return(residential_instant_verify_proof) - allow(residential_instant_verify_proof).to receive(:success?).and_return(true) + context 'LexisNexis InstantVerify fails for id address & passes for residential address' do + let(:aamva_proofer) { instance_double(Proofing::Aamva::Proofer) } + let(:result_that_failed_instant_verify) do + instance_double(Proofing::Resolution::Result) + end - expect(instant_verify_proofer).to receive(:proof).exactly(:once) + before do + allow(instance).to receive(:state_id_proofer).and_return(aamva_proofer) + allow(instance).to receive(:proof_id_address_with_lexis_nexis_if_needed). + and_return(result_that_failed_instant_verify) + allow(instant_verify_proofer).to receive(:proof).with(hash_including(state_id_address)). + and_return(result_that_failed_instant_verify) + end - subject - end + context 'the failure can be covered by AAMVA' do + let(:failed_aamva_proof) { instance_double(Proofing::StateIdResult) } + let(:aamva_proofer) { instance_double(Proofing::Aamva::Proofer) } + before do + allow(instance).to receive(:resolution_proofer).and_return(instant_verify_proofer) + allow(instant_verify_proofer).to receive(:proof).and_return(residential_address_proof) + allow(residential_address_proof).to receive(:success?).and_return(true) - it 'returns distinct objects for the resolution result and residential resolution result' do - result = subject + allow(instance).to receive(:user_can_pass_after_state_id_check?). + with(result_that_failed_instant_verify). + and_return(true) + allow(result_that_failed_instant_verify). + to receive(:attributes_requiring_additional_verification). + and_return([:address]) + allow(instance).to receive(:state_id_proofer).and_return(aamva_proofer) + end + it 'calls AAMVA' do + expect(aamva_proofer).to receive(:proof) - expect(result.residential_resolution_result).to_not eq(result.resolution_result) - expect( - result.residential_resolution_result. - vendor_name, - ).to eq('ResidentialAddressNotRequired') - expect(result.resolution_result.vendor_name).to eq('lexisnexis:instant_verify') + subject + end + end end end end diff --git a/spec/services/proofing/resolution/result_adjudicator_spec.rb b/spec/services/proofing/resolution/result_adjudicator_spec.rb index f517f735617..b3bfd220133 100644 --- a/spec/services/proofing/resolution/result_adjudicator_spec.rb +++ b/spec/services/proofing/resolution/result_adjudicator_spec.rb @@ -29,8 +29,8 @@ end let(:should_proof_state_id) { true } - let(:double_address_verification) { false } - let(:same_address_as_id) { 'true' } + let(:double_address_verification) { true } + let(:same_address_as_id) { 'false' } let(:device_profiling_success) { true } let(:device_profiling_exception) { nil } @@ -57,130 +57,38 @@ end describe '#adjudicated_result' do - context 'double address verification is disabled' do - context 'AAMVA and LexisNexis both pass' do - it 'returns a successful response' do - result = subject.adjudicated_result - - expect(result.success?).to eq(true) - end - end - context 'LexisNexis fails with attributes covered by AAMVA response' do + context 'residential address and id address are different' do + context 'LexisNexis fails for the residential address' do let(:resolution_success) { false } - let(:can_pass_with_additional_verification) { true } - let(:attributes_requiring_additional_verification) { [:dob] } - let(:state_id_verified_attributes) { [:dob, :address] } - - it 'returns a successful response' do - result = subject.adjudicated_result - - expect(result.success?).to eq(true) + let(:residential_resolution_result) do + Proofing::Resolution::Result.new( + success: resolution_success, + errors: {}, + exception: nil, + vendor_name: 'test-resolution-vendor', + failed_result_can_pass_with_additional_verification: + can_pass_with_additional_verification, + attributes_requiring_additional_verification: + attributes_requiring_additional_verification, + ) end - end - - context 'LexisNexis fails with attributes not covered by AAMVA response' do - let(:resolution_success) { false } - let(:can_pass_with_additional_verification) { true } - let(:attributes_requiring_additional_verification) { [:address] } - let(:state_id_verified_attributes) { [:dob] } - it 'returns a failed response' do result = subject.adjudicated_result expect(result.success?).to eq(false) + resolution_adjudication_reason = result.extra[:context][:resolution_adjudication_reason] + expect(resolution_adjudication_reason).to eq(:fail_resolution_skip_state_id) end end - context 'LexisNexis fails and AAMVA state is unsupported' do - let(:should_proof_state_id) { false } - let(:resolution_success) { false } - - it 'returns a failed response' do - result = subject.adjudicated_result - - expect(result.success?).to eq(false) - end - end - - context 'LexisNexis passes and AAMVA fails' do - let(:resolution_success) { true } + context 'AAMVA fails for the id address' do let(:state_id_success) { false } - it 'returns a failed response' do result = subject.adjudicated_result expect(result.success?).to eq(false) - end - end - - context 'Device profiling fails and everything else passes' do - let(:device_profiling_success) { false } - let(:device_profiling_review_status) { 'fail' } - - it 'returns a successful response including the review status' do - result = subject.adjudicated_result - - expect(result.success?).to eq(true) - - threatmetrix_context = result.extra[:context][:stages][:threatmetrix] - expect(threatmetrix_context[:success]).to eq(false) - expect(threatmetrix_context[:review_status]).to eq('fail') - end - end - - context 'Device profiling experiences an exception' do - let(:device_profiling_success) { false } - let(:device_profiling_exception) { 'this is a test value' } - - it 'returns a failed response' do - result = subject.adjudicated_result - - expect(result.success?).to eq(false) - - threatmetrix_context = result.extra[:context][:stages][:threatmetrix] - expect(threatmetrix_context[:success]).to eq(false) - expect(threatmetrix_context[:exception]).to eq('this is a test value') - end - end - end - - context 'double address verification is enabled' do - let(:double_address_verification) { true } - let(:should_proof_state_id) { true } - context 'residential address and id address are different' do - let(:same_address_as_id) { 'false' } - context 'LexisNexis fails for the residential address' do - let(:resolution_success) { false } - let(:residential_resolution_result) do - Proofing::Resolution::Result.new( - success: resolution_success, - errors: {}, - exception: nil, - vendor_name: 'test-resolution-vendor', - failed_result_can_pass_with_additional_verification: - can_pass_with_additional_verification, - attributes_requiring_additional_verification: - attributes_requiring_additional_verification, - ) - end - it 'returns a failed response' do - result = subject.adjudicated_result - - expect(result.success?).to eq(false) - resolution_adjudication_reason = result.extra[:context][:resolution_adjudication_reason] - expect(resolution_adjudication_reason).to eq(:fail_resolution_skip_state_id) - end - end - - context 'AAMVA fails for the id address' do - let(:state_id_success) { false } - it 'returns a failed response' do - result = subject.adjudicated_result - - expect(result.success?).to eq(false) - resolution_adjudication_reason = result.extra[:context][:resolution_adjudication_reason] - expect(resolution_adjudication_reason).to eq(:fail_state_id) - end + resolution_adjudication_reason = result.extra[:context][:resolution_adjudication_reason] + expect(resolution_adjudication_reason).to eq(:fail_state_id) end end end diff --git a/spec/services/usps_in_person_proofing/enrollment_helper_spec.rb b/spec/services/usps_in_person_proofing/enrollment_helper_spec.rb index 449e313ede8..c822c491bad 100644 --- a/spec/services/usps_in_person_proofing/enrollment_helper_spec.rb +++ b/spec/services/usps_in_person_proofing/enrollment_helper_spec.rb @@ -8,7 +8,7 @@ let(:current_address_matches_id) { false } let(:pii) do Pii::Attributes.new_from_hash( - Idp::Constants::MOCK_IDV_APPLICANT_WITH_PHONE. + Idp::Constants::MOCK_IDV_APPLICANT_SAME_ADDRESS_AS_ID_WITH_PHONE. merge(same_address_as_id: current_address_matches_id ? 'true' : 'false'). transform_keys(&:to_s), ) @@ -18,7 +18,6 @@ let(:transliterator) { UspsInPersonProofing::Transliterator.new } let(:service_provider) { nil } let(:usps_ipp_transliteration_enabled) { true } - let(:in_person_capture_secondary_id_enabled) { false } let(:usps_ipp_enrollment_status_update_email_address) do 'registration@usps.local.identitysandbox.gov' end @@ -38,8 +37,6 @@ allow(subject).to receive(:analytics).and_return(subject_analytics) allow(IdentityConfig.store).to receive(:usps_ipp_transliteration_enabled). and_return(usps_ipp_transliteration_enabled) - allow(IdentityConfig.store).to receive(:in_person_capture_secondary_id_enabled). - and_return(in_person_capture_secondary_id_enabled) end describe '#schedule_in_person_enrollment' do @@ -102,7 +99,7 @@ subject.schedule_in_person_enrollment(user, pii) end - describe 'double address verification' do + context 'same address as id is false' do let(:pii) do Pii::Attributes.new_from_hash( Idp::Constants::MOCK_IDV_APPLICANT_WITH_PHONE. @@ -112,46 +109,24 @@ ) end - context 'feature enabled' do - let(:in_person_capture_secondary_id_enabled) { true } - - it 'maps enrollment address fields' do - expect(proofer).to receive(:request_enroll) do |applicant| - ADDR = Idp::Constants::MOCK_IDV_APPLICANT_STATE_ID_ADDRESS - expect(applicant).to have_attributes( - address: Idp::Constants::MOCK_IDV_APPLICANT_STATE_ID_ADDRESS[ - :identity_doc_address1 - ], - city: Idp::Constants::MOCK_IDV_APPLICANT_STATE_ID_ADDRESS[:identity_doc_city], - state: Idp::Constants::MOCK_IDV_APPLICANT_STATE_ID_ADDRESS[ - :identity_doc_address_state - ], - zip_code: - Idp::Constants::MOCK_IDV_APPLICANT_STATE_ID_ADDRESS[:identity_doc_zipcode], - ) - UspsInPersonProofing::Mock::Proofer.new.request_enroll(applicant) - end - - subject.schedule_in_person_enrollment(user, pii) + it 'maps enrollment address fields' do + expect(proofer).to receive(:request_enroll) do |applicant| + ADDR = Idp::Constants::MOCK_IDV_APPLICANT_STATE_ID_ADDRESS + expect(applicant).to have_attributes( + address: Idp::Constants::MOCK_IDV_APPLICANT_STATE_ID_ADDRESS[ + :identity_doc_address1 + ], + city: Idp::Constants::MOCK_IDV_APPLICANT_STATE_ID_ADDRESS[:identity_doc_city], + state: Idp::Constants::MOCK_IDV_APPLICANT_STATE_ID_ADDRESS[ + :identity_doc_address_state + ], + zip_code: + Idp::Constants::MOCK_IDV_APPLICANT_STATE_ID_ADDRESS[:identity_doc_zipcode], + ) + UspsInPersonProofing::Mock::Proofer.new.request_enroll(applicant) end - end - - context 'feature disabled' do - let(:in_person_capture_secondary_id_enabled) { false } - - it 'does not map enrollment address fields' do - expect(proofer).to receive(:request_enroll) do |applicant| - expect(applicant).to have_attributes( - address: Idp::Constants::MOCK_IDV_APPLICANT[:address1], - city: Idp::Constants::MOCK_IDV_APPLICANT[:city], - state: Idp::Constants::MOCK_IDV_APPLICANT[:state], - zip_code: Idp::Constants::MOCK_IDV_APPLICANT[:zipcode], - ) - UspsInPersonProofing::Mock::Proofer.new.request_enroll(applicant) - end - subject.schedule_in_person_enrollment(user, pii) - end + subject.schedule_in_person_enrollment(user, pii) end end end @@ -247,29 +222,33 @@ context 'with address line 2 present' do before { pii['address2'] = 'Apartment 227' } - it 'logs the presence of address line 2' do + # this is a pii bundle that adds identity_doc_* values + let(:pii) do + Pii::Attributes.new_from_hash( + Idp::Constants::MOCK_IDV_APPLICANT_STATE_ID_ADDRESS.transform_keys(&:to_s), + ) + end + + it 'does not log the presence of address line 2 only in residential address' do + pii['identity_doc_address2'] = nil + subject.schedule_in_person_enrollment(user, pii) expect(subject_analytics).to have_logged_event( 'USPS IPPaaS enrollment created', enrollment_code: user.in_person_enrollments.first.enrollment_code, enrollment_id: user.in_person_enrollments.first.id, - second_address_line_present: true, + second_address_line_present: false, service_provider: nil, ) end - context 'double address verification active' do - let(:in_person_capture_secondary_id_enabled) { true } - # this is a pii bundle that adds identity_doc_* values - let(:pii) do - Pii::Attributes.new_from_hash( - Idp::Constants::MOCK_IDV_APPLICANT_STATE_ID_ADDRESS.transform_keys(&:to_s), - ) - end + context 'with address line 2 present in state ID address' do + it 'logs the presence of address line 2' do + expect(pii['identity_doc_address2'].present?).to eq(true) - it 'does not log the presence of address line 2 only in residential address' do - pii['identity_doc_address2'] = nil + pii['same_address_as_id'] = false + pii['address2'] = nil subject.schedule_in_person_enrollment(user, pii) @@ -277,29 +256,10 @@ 'USPS IPPaaS enrollment created', enrollment_code: user.in_person_enrollments.first.enrollment_code, enrollment_id: user.in_person_enrollments.first.id, - second_address_line_present: false, + second_address_line_present: true, service_provider: nil, ) end - - context 'with address line 2 present in state ID address' do - it 'logs the presence of address line 2' do - expect(pii['identity_doc_address2'].present?).to eq(true) - - pii['same_address_as_id'] = false - pii['address2'] = nil - - subject.schedule_in_person_enrollment(user, pii) - - expect(subject_analytics).to have_logged_event( - 'USPS IPPaaS enrollment created', - enrollment_code: user.in_person_enrollments.first.enrollment_code, - enrollment_id: user.in_person_enrollments.first.id, - second_address_line_present: true, - service_provider: nil, - ) - end - end end end end diff --git a/spec/support/features/idv_step_helper.rb b/spec/support/features/idv_step_helper.rb index 86b3b700e40..f6150c1ba6d 100644 --- a/spec/support/features/idv_step_helper.rb +++ b/spec/support/features/idv_step_helper.rb @@ -134,7 +134,7 @@ def complete_idv_steps_before_ssn(user = user_with_2fa) # location page complete_location_step(user) # state ID page - fill_out_state_id_form_ok(same_address_as_id: true, capture_secondary_id_enabled: true) + fill_out_state_id_form_ok(same_address_as_id: true) click_idv_continue end diff --git a/spec/support/features/in_person_helper.rb b/spec/support/features/in_person_helper.rb index 8f856af732e..9ae6de8b41e 100644 --- a/spec/support/features/in_person_helper.rb +++ b/spec/support/features/in_person_helper.rb @@ -31,7 +31,7 @@ module InPersonHelper GOOD_IDENTITY_DOC_ZIPCODE = Idp::Constants::MOCK_IDV_APPLICANT_STATE_ID_ADDRESS[:identity_doc_zipcode] - def fill_out_state_id_form_ok(same_address_as_id: false, capture_secondary_id_enabled: false) + def fill_out_state_id_form_ok(same_address_as_id: false) fill_in t('in_person_proofing.form.state_id.first_name'), with: GOOD_FIRST_NAME fill_in t('in_person_proofing.form.state_id.last_name'), with: GOOD_LAST_NAME year, month, day = GOOD_DOB.split('-') @@ -42,40 +42,32 @@ def fill_out_state_id_form_ok(same_address_as_id: false, capture_secondary_id_en from: t('in_person_proofing.form.state_id.state_id_jurisdiction') fill_in t('in_person_proofing.form.state_id.state_id_number'), with: GOOD_STATE_ID_NUMBER - if capture_secondary_id_enabled - fill_in t('in_person_proofing.form.state_id.address1'), with: GOOD_IDENTITY_DOC_ADDRESS1 - fill_in t('in_person_proofing.form.state_id.address2'), with: GOOD_IDENTITY_DOC_ADDRESS2 - fill_in t('in_person_proofing.form.state_id.city'), with: GOOD_IDENTITY_DOC_CITY - fill_in t('in_person_proofing.form.state_id.zipcode'), with: GOOD_IDENTITY_DOC_ZIPCODE - if same_address_as_id - select GOOD_IDENTITY_DOC_ADDRESS_STATE, - from: t('in_person_proofing.form.state_id.identity_doc_address_state') - choose t('in_person_proofing.form.state_id.same_address_as_id_yes') - else - select GOOD_STATE, from: t('in_person_proofing.form.state_id.identity_doc_address_state') - choose t('in_person_proofing.form.state_id.same_address_as_id_no') - end + fill_in t('in_person_proofing.form.state_id.address1'), with: GOOD_IDENTITY_DOC_ADDRESS1 + fill_in t('in_person_proofing.form.state_id.address2'), with: GOOD_IDENTITY_DOC_ADDRESS2 + fill_in t('in_person_proofing.form.state_id.city'), with: GOOD_IDENTITY_DOC_CITY + fill_in t('in_person_proofing.form.state_id.zipcode'), with: GOOD_IDENTITY_DOC_ZIPCODE + select GOOD_STATE_ID_JURISDICTION, + from: t('in_person_proofing.form.state_id.identity_doc_address_state') + if same_address_as_id + choose t('in_person_proofing.form.state_id.same_address_as_id_yes') + else + choose t('in_person_proofing.form.state_id.same_address_as_id_no') end end - def fill_out_address_form_ok(double_address_verification: false, same_address_as_id: false) + def fill_out_address_form_ok(same_address_as_id: false) fill_in t('idv.form.address1'), with: same_address_as_id ? GOOD_IDENTITY_DOC_ADDRESS1 : GOOD_ADDRESS1 - fill_in t('idv.form.address2_optional'), with: GOOD_ADDRESS2 unless double_address_verification fill_in t('idv.form.address2'), with: same_address_as_id ? GOOD_IDENTITY_DOC_ADDRESS2 : GOOD_ADDRESS2 fill_in t('idv.form.city'), with: same_address_as_id ? GOOD_IDENTITY_DOC_CITY : GOOD_CITY fill_in t('idv.form.zipcode'), with: same_address_as_id ? GOOD_IDENTITY_DOC_ZIPCODE : GOOD_ZIPCODE if same_address_as_id - select GOOD_IDENTITY_DOC_ADDRESS_STATE, from: t('idv.form.state') + select GOOD_STATE_ID_JURISDICTION, from: t('idv.form.state') else select GOOD_STATE, from: t('idv.form.state') end - - unless double_address_verification - choose t('in_person_proofing.form.address.same_address_choice_yes') - end end def begin_in_person_proofing(_user = nil) @@ -122,23 +114,19 @@ def complete_prepare_step(_user = nil) click_on t('forms.buttons.continue') end - def complete_state_id_step(_user = nil, same_address_as_id: true, - capture_secondary_id_enabled: false) + def complete_state_id_step(_user = nil, same_address_as_id: true) # Wait for page to load before attempting to fill out form expect(page).to have_current_path(idv_in_person_step_path(step: :state_id), wait: 10) - fill_out_state_id_form_ok( - same_address_as_id: same_address_as_id, - capture_secondary_id_enabled: capture_secondary_id_enabled, - ) + fill_out_state_id_form_ok(same_address_as_id: same_address_as_id) click_idv_continue - unless capture_secondary_id_enabled && same_address_as_id + unless same_address_as_id expect(page).to have_current_path(idv_in_person_step_path(step: :address), wait: 10) expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.verify_info')) end end - def complete_address_step(_user = nil, double_address_verification: false) - fill_out_address_form_ok(double_address_verification: double_address_verification) + def complete_address_step(_user = nil, same_address_as_id: true) + fill_out_address_form_ok(same_address_as_id: same_address_as_id) click_idv_continue end @@ -151,11 +139,11 @@ def complete_verify_step(_user = nil) click_idv_continue end - def complete_all_in_person_proofing_steps(user = user_with_2fa) + def complete_all_in_person_proofing_steps(user = user_with_2fa, same_address_as_id: true) complete_prepare_step(user) complete_location_step(user) - complete_state_id_step(user) - complete_address_step(user) + complete_state_id_step(user, same_address_as_id: same_address_as_id) + complete_address_step(user, same_address_as_id: same_address_as_id) unless same_address_as_id complete_ssn_step(user) complete_verify_step(user) end @@ -202,4 +190,41 @@ def mark_in_person_enrollment_passed(user) enrollment.profile.activate_after_passing_in_person enrollment.update(status: :passed) end + + def perform_mobile_hybrid_steps + perform_in_browser(:mobile) do + # doc auth page + visit @sms_link + mock_doc_auth_attention_with_barcode + attach_and_submit_images + + # error page + click_button t('in_person_proofing.body.cta.button') + # prepare page + expect(page).to(have_content(t('in_person_proofing.body.prepare.verify_step_about'))) + click_idv_continue + # location page + expect(page).to have_content(t('in_person_proofing.headings.po_search.location')) + complete_location_step + + # switch back page + expect(page).to have_content(t('in_person_proofing.headings.switch_back')) + end + end + + def perform_desktop_hybrid_steps(user = user_with_2fa, same_address_as_id: true) + perform_in_browser(:desktop) do + expect(page).to have_current_path(idv_in_person_step_path(step: :state_id), wait: 10) + + complete_state_id_step(user, same_address_as_id: same_address_as_id) + complete_address_step(user, same_address_as_id: same_address_as_id) unless same_address_as_id + complete_ssn_step(user) + complete_verify_step(user) + complete_phone_step(user) + complete_review_step(user) + acknowledge_and_confirm_personal_key + + expect(page).to have_content('MILWAUKEE') + end + end end diff --git a/spec/views/idv/in_person/ready_to_verify/show.html.erb_spec.rb b/spec/views/idv/in_person/ready_to_verify/show.html.erb_spec.rb index 76583e5bacb..ef12a9aa5a8 100644 --- a/spec/views/idv/in_person/ready_to_verify/show.html.erb_spec.rb +++ b/spec/views/idv/in_person/ready_to_verify/show.html.erb_spec.rb @@ -65,26 +65,6 @@ ) end - context 'with enrollment where current address matches id' do - let(:current_address_matches_id) { true } - - it 'renders without proof of address instructions' do - render - - expect(rendered).not_to have_content(t('in_person_proofing.process.proof_of_address.heading')) - end - end - - context 'with enrollment where current address does not match id' do - let(:current_address_matches_id) { false } - - it 'renders with proof of address instructions' do - render - - expect(rendered).to have_content(t('in_person_proofing.process.proof_of_address.heading')) - end - end - context 'with enrollment where selected_location_details is present' do it 'renders a location' do render