diff --git a/app/controllers/idv/gpo_controller.rb b/app/controllers/idv/gpo_controller.rb index c306429a52f..08a8edac004 100644 --- a/app/controllers/idv/gpo_controller.rb +++ b/app/controllers/idv/gpo_controller.rb @@ -210,7 +210,6 @@ def enqueue_job document_capture_session, should_proof_state_id: false, trace_id: amzn_trace_id, - document_expired: idv_session.document_expired, ) end diff --git a/app/jobs/resolution_proofing_job.rb b/app/jobs/resolution_proofing_job.rb index ab3daff1a5d..fb2209b1801 100644 --- a/app/jobs/resolution_proofing_job.rb +++ b/app/jobs/resolution_proofing_job.rb @@ -13,7 +13,7 @@ class ResolutionProofingJob < ApplicationJob ) def perform(result_id:, encrypted_arguments:, trace_id:, should_proof_state_id:, - dob_year_only:, document_expired:) + dob_year_only:) timer = JobHelpers::Timer.new raise_stale_job! if stale_job?(enqueued_at) @@ -25,7 +25,7 @@ def perform(result_id:, encrypted_arguments:, trace_id:, should_proof_state_id:, applicant_pii = decrypted_args[:applicant_pii] - callback_log_data = if !document_expired && dob_year_only && should_proof_state_id + callback_log_data = if dob_year_only && should_proof_state_id proof_aamva_then_lexisnexis_dob_only( timer: timer, applicant_pii: applicant_pii, @@ -36,7 +36,6 @@ def perform(result_id:, encrypted_arguments:, trace_id:, should_proof_state_id:, timer: timer, applicant_pii: applicant_pii, should_proof_state_id: should_proof_state_id, - document_expired: document_expired, ) end @@ -57,7 +56,7 @@ def perform(result_id:, encrypted_arguments:, trace_id:, should_proof_state_id:, private # @return [CallbackLogData] - def proof_lexisnexis_then_aamva(timer:, applicant_pii:, should_proof_state_id:, document_expired:) + def proof_lexisnexis_then_aamva(timer:, applicant_pii:, should_proof_state_id:) proofer_result = timer.time('resolution') do resolution_proofer.proof(applicant_pii) end @@ -89,7 +88,7 @@ def proof_lexisnexis_then_aamva(timer:, applicant_pii:, should_proof_state_id:, } state_id_success = nil - if should_proof_state_id && result[:success] && !document_expired + if should_proof_state_id && result[:success] timer.time('state_id') do proof_state_id(applicant_pii: applicant_pii, result: result) end diff --git a/app/services/doc_auth_router.rb b/app/services/doc_auth_router.rb index 01ccc537e20..c0eb91bfb0d 100644 --- a/app/services/doc_auth_router.rb +++ b/app/services/doc_auth_router.rb @@ -112,9 +112,6 @@ def respond_to_missing?(method_name, include_private = false) def translate_form_response!(response) return response unless response.is_a?(DocAuth::Response) - # This needs to happen before we translate, since it relies on the original error keys - response = ExpiredLicenseAllower.new(response).processed_response - translate_doc_auth_errors!(response) translate_generic_errors!(response) diff --git a/app/services/expired_license_allower.rb b/app/services/expired_license_allower.rb deleted file mode 100644 index bd9b9a6f5ae..00000000000 --- a/app/services/expired_license_allower.rb +++ /dev/null @@ -1,59 +0,0 @@ -# Needs the "raw" response error codes, which needs to happen before translation -class ExpiredLicenseAllower - # @param [DocAuth::Response] - def initialize(response) - @response = response - end - - # When we allow expired drivers licenses, returns a successful response - # @return [DocAuth::Response] - def processed_response - if document_expired? - if IdentityConfig.store.proofing_allow_expired_license && allowable_expired_license? - DocAuth::Response.new( - success: true, # new response with explicit true overrides success - errors: {}, - exception: response.exception, - extra: response.extra.merge( - document_expired: document_expired?, - ), - pii_from_doc: response.pii_from_doc, - ) - else - response.merge( - DocAuth::Response.new( - success: true, # merge uses "&&" to combine success, so this does not override - extra: { - document_expired: document_expired?, - would_have_passed: allowable_expired_license?, - }, - ), - ) - end - else - response - end - end - - def document_expired? - !!response.errors[:id]&.include?(DocAuth::Errors::DOCUMENT_EXPIRED_CHECK) - end - - def only_error_was_document_expired? - response.errors.keys == [:id] && - response.errors[:id] == [DocAuth::Errors::DOCUMENT_EXPIRED_CHECK] - end - - def allowable_expired_license? - !!( - only_error_was_document_expired? && - response.pii_from_doc[:state_id_expiration] && - (state_id_exp = Date.parse(response.pii_from_doc[:state_id_expiration])) && - state_id_exp >= IdentityConfig.store.proofing_expired_license_after - ) - end - - private - - attr_reader :response -end diff --git a/app/services/idv/agent.rb b/app/services/idv/agent.rb index d3f8dba3441..42e8ca58641 100644 --- a/app/services/idv/agent.rb +++ b/app/services/idv/agent.rb @@ -5,10 +5,7 @@ def initialize(applicant) end def proof_resolution( - document_capture_session, - should_proof_state_id:, - trace_id:, - document_expired: + document_capture_session, should_proof_state_id:, trace_id: ) document_capture_session.create_proofing_session @@ -22,7 +19,6 @@ def proof_resolution( dob_year_only: IdentityConfig.store.proofing_send_partial_dob, trace_id: trace_id, result_id: document_capture_session.result_id, - document_expired: document_expired, } if IdentityConfig.store.ruby_workers_idv_enabled diff --git a/app/services/idv/profile_maker.rb b/app/services/idv/profile_maker.rb index 47527029968..1c93d0a7170 100644 --- a/app/services/idv/profile_maker.rb +++ b/app/services/idv/profile_maker.rb @@ -2,11 +2,10 @@ module Idv class ProfileMaker attr_reader :pii_attributes - def initialize(applicant:, user:, user_password:, document_expired:) + def initialize(applicant:, user:, user_password:) self.pii_attributes = Pii::Attributes.new_from_hash(applicant) self.user = user self.user_password = user_password - self.document_expired = document_expired end def save_profile @@ -16,9 +15,6 @@ def save_profile ) profile.encrypt_pii(pii_attributes, user_password) profile.proofing_components = current_proofing_components - if document_expired - profile.reproof_at = IdentityConfig.store.proofing_expired_license_reproof_at - end profile.save! profile end @@ -29,7 +25,7 @@ def current_proofing_components user.proofing_component&.as_json || {} end - attr_accessor :user, :user_password, :phone_confirmed, :document_expired + attr_accessor :user, :user_password, :phone_confirmed attr_writer :pii_attributes end end diff --git a/app/services/idv/session.rb b/app/services/idv/session.rb index c79ff3531ab..bf1eb5b0316 100644 --- a/app/services/idv/session.rb +++ b/app/services/idv/session.rb @@ -113,10 +113,6 @@ def user_phone_confirmation_session=(new_user_phone_confirmation_session) session[:user_phone_confirmation_session] = new_user_phone_confirmation_session.to_h end - def document_expired - user_session.dig('idv/doc_auth', :document_expired) # via flow_session[:document_expired] - end - private attr_accessor :user_session @@ -144,7 +140,6 @@ def build_profile_maker(user_password) applicant: applicant, user: current_user, user_password: user_password, - document_expired: document_expired, ) end end diff --git a/app/services/idv/steps/doc_auth_base_step.rb b/app/services/idv/steps/doc_auth_base_step.rb index c6bb1400c13..6c76ac3a905 100644 --- a/app/services/idv/steps/doc_auth_base_step.rb +++ b/app/services/idv/steps/doc_auth_base_step.rb @@ -65,13 +65,6 @@ def extract_pii_from_doc(response) phone: effective_user.phone_configurations.take&.phone, uuid_prefix: ServiceProvider.find_by(issuer: sp_session[:issuer])&.app_id, ) - if response.respond_to?(:extra) - # Sync flow: DocAuth::Response - flow_session[:document_expired] = response.extra&.dig(:document_expired) - elsif response.respond_to?(:result) - # Async flow: DocumentCaptureSessionAsyncResult - flow_session[:document_expired] = response.result&.dig(:document_expired) - end track_document_state end diff --git a/app/services/idv/steps/verify_step.rb b/app/services/idv/steps/verify_step.rb index 393d6132007..6527c34efe9 100644 --- a/app/services/idv/steps/verify_step.rb +++ b/app/services/idv/steps/verify_step.rb @@ -41,7 +41,6 @@ def enqueue_job document_capture_session, should_proof_state_id: should_use_aamva?(pii_from_doc), trace_id: amzn_trace_id, - document_expired: document_expired, ) end @@ -49,10 +48,6 @@ def pii_from_doc flow_session[:pii_from_doc] end - def document_expired - flow_session[:document_expired] - end - def idv_agent @idv_agent ||= Idv::Agent.new(pii_from_doc) end diff --git a/config/application.yml.default b/config/application.yml.default index bc97d07472e..e859453ab6a 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -164,9 +164,6 @@ piv_cac_verify_token_url: https://localhost:8443/ platform_authentication_enabled: true poll_rate_for_verify_in_seconds: 3 proofer_mock_fallback: true -proofing_allow_expired_license: false -proofing_expired_license_after: '2020-03-01' -proofing_expired_license_reproof_at: '2023-03-01' proofing_send_partial_dob: false proof_address_max_attempts: 5 proof_address_max_attempt_window_in_minutes: 360 diff --git a/lib/identity_config.rb b/lib/identity_config.rb index bbf812fe88f..fded8f0d9fe 100644 --- a/lib/identity_config.rb +++ b/lib/identity_config.rb @@ -247,9 +247,6 @@ def self.build_store(config_map) config.add(:platform_authentication_enabled, type: :boolean) config.add(:poll_rate_for_verify_in_seconds, type: :integer) config.add(:proofer_mock_fallback, type: :boolean) - config.add(:proofing_allow_expired_license, type: :boolean) - config.add(:proofing_expired_license_after, type: :date) - config.add(:proofing_expired_license_reproof_at, type: :date) config.add(:proofing_send_partial_dob, type: :boolean) config.add(:proof_address_max_attempts, type: :integer) config.add(:proof_address_max_attempt_window_in_minutes, type: :integer) diff --git a/spec/controllers/idv/personal_key_controller_spec.rb b/spec/controllers/idv/personal_key_controller_spec.rb index 46422d23ca7..fe88e84ab5d 100644 --- a/spec/controllers/idv/personal_key_controller_spec.rb +++ b/spec/controllers/idv/personal_key_controller_spec.rb @@ -17,7 +17,6 @@ def stub_idv_session applicant: applicant, user: user, user_password: password, - document_expired: nil, ) profile = profile_maker.save_profile idv_session.pii = profile_maker.pii_attributes diff --git a/spec/features/idv/doc_auth/document_capture_step_spec.rb b/spec/features/idv/doc_auth/document_capture_step_spec.rb index eaace3d158a..ff7a7072623 100644 --- a/spec/features/idv/doc_auth/document_capture_step_spec.rb +++ b/spec/features/idv/doc_auth/document_capture_step_spec.rb @@ -350,78 +350,6 @@ end end - context 'when the only error is an expired drivers license' do - before do - allow(IdentityConfig.store).to receive(:proofing_allow_expired_license). - and_return(proofing_allow_expired_license) - allow(IdentityConfig.store).to receive(:proofing_expired_license_after). - and_return(Date.new(2020, 3, 1)) - - allow_any_instance_of(ApplicationController). - to receive(:analytics).and_return(fake_analytics) - - DocAuth::Mock::DocAuthMockClient.mock_response!( - method: :post_images, - response: DocAuth::Response.new( - pii_from_doc: DocAuth::Mock::ResultResponseBuilder::DEFAULT_PII_FROM_DOC.merge( - state_id_expiration: '2020-04-01', - ), - success: false, - errors: { - id: [DocAuth::Errors::DOCUMENT_EXPIRED_CHECK], - }, - ), - ) - end - - context 'when expired licenses are not allowed' do - let(:proofing_allow_expired_license) { false } - - it 'shows an error and does not go to the next page' do - attach_and_submit_images - expect(page).to have_current_path(idv_doc_auth_document_capture_step) - - expect(fake_analytics).to have_logged_event( - 'IdV: ' + "#{Analytics::DOC_AUTH} document_capture submitted".downcase, - document_expired: true, - would_have_passed: true, - ) - end - end - - context 'when expired licenses are allowed' do - let(:proofing_allow_expired_license) { true } - - it 'proceeds to the next page and saves reproof_at to the profile' do - attach_and_submit_images - expect(page).to have_current_path(next_step) - - expect(fake_analytics).to have_logged_event( - 'IdV: ' + "#{Analytics::DOC_AUTH} document_capture submitted".downcase, - document_expired: true, - ) - - # finish the rest of the flow so we can make sure the data is plumbed through - fill_out_ssn_form_ok - click_idv_continue - - expect(page).to have_content(t('doc_auth.headings.verify')) - click_idv_continue - - fill_out_phone_form_mfa_phone(user) - click_idv_continue - - fill_in :user_password, with: Features::SessionHelper::VALID_PASSWORD - click_idv_continue - - acknowledge_and_confirm_personal_key(js: false) - - profile = user.active_profile - expect(profile.reproof_at).to eq(IdentityConfig.store.proofing_expired_license_reproof_at) - end - end - end - context 'when using async uploads', :js do before do allow(DocumentProofingJob).to receive(:perform_later). @@ -487,55 +415,6 @@ expect(back_plain.b).to eq(original.b) end end - - context 'when expired licenses are allowed' do - before do - allow(IdentityConfig.store).to receive(:proofing_allow_expired_license).and_return(true) - - DocAuth::Mock::DocAuthMockClient.mock_response!( - method: :post_images, - response: DocAuth::Response.new( - success: false, - pii_from_doc: DocAuth::Mock::ResultResponseBuilder::DEFAULT_PII_FROM_DOC.merge( - state_id_expiration: '2020-04-01', - ), - errors: { - id: [DocAuth::Errors::DOCUMENT_EXPIRED_CHECK], - }, - ), - ) - end - - it 'proceeds to the next page and saves reproof_at to the profile' do - attach_file 'Front of your ID', 'app/assets/images/logo.png' - attach_file 'Back of your ID', 'app/assets/images/logo.png' - - form = page.find('#document-capture-form') - front_url = form['data-front-image-upload-url'] - back_url = form['data-back-image-upload-url'] - click_on 'Submit' - - expect(page).to have_current_path(next_step, wait: 20) - - # finish the rest of the flow so we can make sure the data is plumbed through - fill_out_ssn_form_ok - click_idv_continue - - expect(page).to have_content(t('doc_auth.headings.verify')) - click_idv_continue - - fill_out_phone_form_mfa_phone(user) - click_idv_continue - - fill_in :user_password, with: Features::SessionHelper::VALID_PASSWORD - click_idv_continue - - acknowledge_and_confirm_personal_key(js: true) - - profile = user.active_profile - expect(profile.reproof_at).to eq(IdentityConfig.store.proofing_expired_license_reproof_at) - end - end end def next_step diff --git a/spec/features/idv/doc_auth/verify_step_spec.rb b/spec/features/idv/doc_auth/verify_step_spec.rb index dc4a75f4e53..edcc4e72563 100644 --- a/spec/features/idv/doc_auth/verify_step_spec.rb +++ b/spec/features/idv/doc_auth/verify_step_spec.rb @@ -172,10 +172,7 @@ click_idv_continue expect(agent).to have_received(:proof_resolution).with( - anything, - should_proof_state_id: true, - document_expired: nil, - trace_id: anything, + anything, should_proof_state_id: true, trace_id: anything ) end end @@ -198,10 +195,7 @@ click_idv_continue expect(agent).to have_received(:proof_resolution).with( - anything, - should_proof_state_id: false, - document_expired: nil, - trace_id: anything, + anything, should_proof_state_id: false, trace_id: anything ) expect(DocAuthLog.find_by(user_id: user.id).aamva).to be_nil end @@ -224,10 +218,7 @@ click_idv_continue expect(agent).to have_received(:proof_resolution).with( - anything, - should_proof_state_id: false, - document_expired: nil, - trace_id: anything, + anything, should_proof_state_id: false, trace_id: anything ) end end diff --git a/spec/jobs/document_proofing_job_spec.rb b/spec/jobs/document_proofing_job_spec.rb index 43ced7039f5..10a3726d58a 100644 --- a/spec/jobs/document_proofing_job_spec.rb +++ b/spec/jobs/document_proofing_job_spec.rb @@ -243,57 +243,6 @@ end end - context 'with an unsuccessful response from the proofer' do - let(:doc_auth_client) { instance_double(DocAuth::Acuant::AcuantClient) } - - before do - allow(instance).to receive(:build_doc_auth_client).and_return(doc_auth_client) - - expect(doc_auth_client).to receive(:post_images). - and_return(DocAuth::Response.new(success: false, exception: RuntimeError.new)) - end - - it 'returns a response' do - perform - - result = document_capture_session.load_doc_auth_async_result - - expect(result.result[:success]).to eq(false) - end - end - - context 'with an expired license response from the proofer' do - before do - allow(IdentityConfig.store).to receive(:proofing_allow_expired_license).and_return(true) - allow(IdentityConfig.store).to receive(:proofing_expired_license_after). - and_return(Date.new(2020, 3, 1)) - allow(IdentityConfig.store).to receive(:proofing_expired_license_reproof_at). - and_return(Date.new(2025, 3, 1)) - - DocAuth::Mock::DocAuthMockClient.mock_response!( - method: :post_images, - response: DocAuth::Response.new( - success: false, - pii_from_doc: DocAuth::Mock::ResultResponseBuilder::DEFAULT_PII_FROM_DOC.merge( - state_id_expiration: '2020-04-01', - ), - errors: { - id: [DocAuth::Errors::DOCUMENT_EXPIRED_CHECK], - }, - ), - ) - end - - it 'records the document expired status in the result' do - perform - - result = document_capture_session.load_doc_auth_async_result - - expect(result.result[:success]).to eq(true) - expect(result.result[:document_expired]).to eq(true) - end - end - context 'with local image URLs instead of S3 URLs' do let(:front_image_url) { 'http://example.com/bar1' } let(:back_image_url) { 'http://example.com/bar2' } diff --git a/spec/jobs/resolution_proofing_job_spec.rb b/spec/jobs/resolution_proofing_job_spec.rb index c33563c0b55..9c55a9b0af1 100644 --- a/spec/jobs/resolution_proofing_job_spec.rb +++ b/spec/jobs/resolution_proofing_job_spec.rb @@ -39,7 +39,6 @@ instance_double(Proofing::Aamva::Proofer, class: Proofing::Aamva::Proofer) end let(:trace_id) { SecureRandom.uuid } - let(:document_expired) { false } describe '.perform_later' do it 'stores results' do @@ -49,7 +48,6 @@ dob_year_only: dob_year_only, encrypted_arguments: encrypted_arguments, trace_id: trace_id, - document_expired: document_expired, ) result = document_capture_session.load_proofing_result[:result] @@ -67,7 +65,6 @@ dob_year_only: dob_year_only, encrypted_arguments: encrypted_arguments, trace_id: trace_id, - document_expired: document_expired, ) end @@ -336,19 +333,6 @@ expect(result.dig(:reference)).to eq(lexisnexis_reference) end end - - context 'with an expired document in an AAMVA state' do - let(:document_expired) { true } - let(:should_proof_state_id) { true } - - it 'does not send the data to AAMVA' do - expect(resolution_proofer).to receive(:proof). - and_return(Proofing::Result.new) - - expect(state_id_proofer).not_to receive(:proof) - perform - end - end end context 'a stale job' do diff --git a/spec/services/doc_auth_router_spec.rb b/spec/services/doc_auth_router_spec.rb index e7b73c7ee32..ce2f5d69dad 100644 --- a/spec/services/doc_auth_router_spec.rb +++ b/spec/services/doc_auth_router_spec.rb @@ -266,32 +266,6 @@ ) end - context 'when the errors include DOCUMENT_EXPIRED' do - context 'when there are multiple errors' do - before do - DocAuth::Mock::DocAuthMockClient.mock_response!( - method: :post_images, - response: DocAuth::Response.new( - success: false, - errors: { - id: [ - DocAuth::Errors::EXPIRATION_CHECKS, - DocAuth::Errors::DOCUMENT_EXPIRED_CHECK, - ], - general: [DocAuth::Errors::GENERAL_ERROR_LIVENESS], - }, - ), - ) - end - - it 'sets extra[:document_expired]' do - response = proxy.post_images(front_image: 'a', back_image: 'b', selfie_image: 'c') - - expect(response.extra[:document_expired]).to eq(true) - end - end - end - it 'translates http response errors and maintains exceptions' do DocAuth::Mock::DocAuthMockClient.mock_response!( method: :post_images, diff --git a/spec/services/expired_license_allower_spec.rb b/spec/services/expired_license_allower_spec.rb deleted file mode 100644 index 6fb7899405a..00000000000 --- a/spec/services/expired_license_allower_spec.rb +++ /dev/null @@ -1,138 +0,0 @@ -require 'rails_helper' - -RSpec.describe ExpiredLicenseAllower do - subject(:allower) { ExpiredLicenseAllower.new(response) } - - let(:proofing_allow_expired_license) { false } - let(:proofing_expired_license_after) { Date.new(2021, 3, 1) } - - let(:response) { DocAuth::Response.new } - - before do - allow(IdentityConfig.store).to receive(:proofing_allow_expired_license). - and_return(proofing_allow_expired_license) - allow(IdentityConfig.store).to receive(:proofing_expired_license_after). - and_return(proofing_expired_license_after) - end - - describe '#processed_response' do - subject(:processed_response) { allower.processed_response } - - context 'for a response that has no errors' do - let(:response) { DocAuth::Response.new(success: true) } - - it 'does not change the response' do - expect(processed_response).to eq(response) - end - end - - context 'for a response that has DOCUMENT_EXPIRED_CHECK and other errors' do - let(:response) do - DocAuth::Response.new( - success: false, - errors: { - id: [ - DocAuth::Errors::DOCUMENT_EXPIRED_CHECK, - DocAuth::Errors::EXPIRATION_CHECKS, - ], - front: [DocAuth::Errors::VISIBLE_PHOTO_CHECK], - }, - ) - end - - it 'does not change the response success' do - expect(processed_response.success?).to eq(response.success?) - end - - it 'adds document_expired and would_have_passed' do - expect(processed_response.extra).to include( - document_expired: true, - would_have_passed: false, - ) - end - end - - context 'for a response that only has DOCUMENT_EXPIRED_CHECK error' do - let(:response) do - DocAuth::Response.new( - success: false, - pii_from_doc: pii_from_doc, - errors: { - id: [DocAuth::Errors::DOCUMENT_EXPIRED_CHECK], - }, - ) - end - - let(:pii_from_doc) { {} } - - context 'when proofing_allow_expired_license is true' do - let(:proofing_allow_expired_license) { true } - - context 'when the response PII does not have state_id_expiration' do - let(:pii_from_doc) { {} } - - it 'does not change the success' do - expect(processed_response.success?).to eq(false) - end - end - - context 'when the response PII has a state_id_expiration' do - let(:proofing_expired_license_after) { Date.new(2021, 3, 1) } - - context 'when the state_id_expiration is before proofing_expired_license_after' do - let(:pii_from_doc) { { state_id_expiration: '2021-01-01' } } - - it 'does not change the success' do - expect(processed_response.success?).to eq(false) - end - end - - context 'when the state_id_expiration is after proofing_expired_license_after' do - let(:pii_from_doc) { { state_id_expiration: '2021-04-01' } } - - it 'returns a successful response with document_expired' do - expect(processed_response).to_not eq(response) - - expect(processed_response.success?).to eq(true) - expect(processed_response.extra[:document_expired]).to eq(true) - end - - it 'overrides the errors to be blank' do - expect(processed_response.errors).to eq({}) - end - end - end - end - - context 'when proofing_allow_expired_license is false' do - let(:proofing_allow_expired_license) { false } - - it 'does not change the success' do - expect(processed_response.success?).to eq(false) - end - - context 'when the state_id_expiration is before proofing_expired_license_after' do - let(:pii_from_doc) { { state_id_expiration: '2021-01-01' } } - - it 'has would_have_passed false' do - expect(processed_response.extra).to include( - document_expired: true, - would_have_passed: false, - ) - end - end - - context 'when the state_id_expiration is after proofing_expired_license_after' do - let(:pii_from_doc) { { state_id_expiration: '2021-04-01' } } - - it 'has would_have_passed true' do - expect(processed_response.extra).to include( - document_expired: true, - would_have_passed: true, - ) - end - end - end - end - end -end diff --git a/spec/services/idv/agent_spec.rb b/spec/services/idv/agent_spec.rb index 56f0e02f63d..0debecd563f 100644 --- a/spec/services/idv/agent_spec.rb +++ b/spec/services/idv/agent_spec.rb @@ -13,7 +13,6 @@ let(:trace_id) { SecureRandom.uuid } let(:agent) { Idv::Agent.new(applicant) } - let(:document_expired) { false } describe '#proof_resolution' do let(:document_capture_session) { DocumentCaptureSession.new(result_id: SecureRandom.hex) } @@ -25,10 +24,7 @@ zipcode: '11111' }, ) agent.proof_resolution( - document_capture_session, - should_proof_state_id: true, - trace_id: trace_id, - document_expired: document_expired, + document_capture_session, should_proof_state_id: true, trace_id: trace_id ) result = document_capture_session.load_proofing_result.result @@ -46,10 +42,7 @@ state_id_jurisdiction: 'MD', ) agent.proof_resolution( - document_capture_session, - should_proof_state_id: true, - trace_id: trace_id, - document_expired: document_expired, + document_capture_session, should_proof_state_id: true, trace_id: trace_id ) result = document_capture_session.load_proofing_result.result expect(result[:context][:stages][:state_id]).to include( @@ -66,10 +59,7 @@ zipcode: '11111' }, ) agent.proof_resolution( - document_capture_session, - should_proof_state_id: true, - trace_id: trace_id, - document_expired: document_expired, + document_capture_session, should_proof_state_id: true, trace_id: trace_id ) result = document_capture_session.load_proofing_result.result expect(result[:errors][:ssn]).to eq ['Unverified SSN.'] @@ -82,10 +72,7 @@ zipcode: '11111' }, ) agent.proof_resolution( - document_capture_session, - should_proof_state_id: false, - trace_id: trace_id, - document_expired: document_expired, + document_capture_session, should_proof_state_id: false, trace_id: trace_id ) result = document_capture_session.load_proofing_result.result @@ -102,10 +89,7 @@ ) agent.proof_resolution( - document_capture_session, - should_proof_state_id: false, - trace_id: trace_id, - document_expired: document_expired, + document_capture_session, should_proof_state_id: false, trace_id: trace_id ) result = document_capture_session.load_proofing_result.result @@ -122,10 +106,7 @@ ) agent.proof_resolution( - document_capture_session, - should_proof_state_id: true, - trace_id: trace_id, - document_expired: document_expired, + document_capture_session, should_proof_state_id: true, trace_id: trace_id ) result = document_capture_session.load_proofing_result.result diff --git a/spec/services/idv/profile_maker_spec.rb b/spec/services/idv/profile_maker_spec.rb index f3e8adc0134..5fb57840654 100644 --- a/spec/services/idv/profile_maker_spec.rb +++ b/spec/services/idv/profile_maker_spec.rb @@ -1,45 +1,32 @@ require 'rails_helper' describe Idv::ProfileMaker do - let(:applicant) { { first_name: 'Some', last_name: 'One' } } - let(:user) { create(:user, :signed_up) } - let(:user_password) { user.password } - let(:document_expired) { nil } - - subject(:profile_maker) do - described_class.new( - applicant: applicant, - user: user, - user_password: user_password, - document_expired: document_expired, - ) - end - describe '#save_profile' do + let(:applicant) { { first_name: 'Some', last_name: 'One' } } + let(:user) { create(:user, :signed_up) } + let(:user_password) { user.password } + + subject do + described_class.new( + applicant: applicant, + user: user, + user_password: user_password, + ) + end it 'creates a Profile with encrypted PII' do proofing_component = ProofingComponent.create(user_id: user.id, document_check: 'acuant') - profile = profile_maker.save_profile - pii = profile_maker.pii_attributes + profile = subject.save_profile + pii = subject.pii_attributes expect(profile).to be_a Profile expect(profile.id).to_not be_nil expect(profile.encrypted_pii).to_not be_nil expect(profile.encrypted_pii).to_not match 'Some' expect(profile.proofing_components).to match proofing_component.as_json - expect(profile.reproof_at).to be_nil expect(pii).to be_a Pii::Attributes expect(pii.first_name).to eq 'Some' - end - - context 'with an expired doucument' do - let(:document_expired) { true } - - it 'saves the profile.reproof_at' do - profile = profile_maker.save_profile - - expect(profile.reproof_at).to eq(IdentityConfig.store.proofing_expired_license_reproof_at) - end + expect(profile.reproof_at).to be_nil end end end diff --git a/spec/services/idv/steps/verify_step_spec.rb b/spec/services/idv/steps/verify_step_spec.rb index 0e59599c114..67904b0854b 100644 --- a/spec/services/idv/steps/verify_step_spec.rb +++ b/spec/services/idv/steps/verify_step_spec.rb @@ -60,7 +60,6 @@ kind_of(DocumentCaptureSession), should_proof_state_id: anything, trace_id: amzn_trace_id, - document_expired: nil, ) step.call