diff --git a/app/jobs/resolution_proofing_job.rb b/app/jobs/resolution_proofing_job.rb index 4e3bb0f0e20..b763f3de590 100644 --- a/app/jobs/resolution_proofing_job.rb +++ b/app/jobs/resolution_proofing_job.rb @@ -12,9 +12,16 @@ class ResolutionProofingJob < ApplicationJob keyword_init: true, ) - def perform(result_id:, encrypted_arguments:, trace_id:, should_proof_state_id:, - dob_year_only:, user_id: nil, threatmetrix_session_id: nil, - request_ip: nil) + def perform( + result_id:, + encrypted_arguments:, + trace_id:, + should_proof_state_id:, + user_id: nil, + threatmetrix_session_id: nil, + request_ip: nil, + dob_year_only: nil # rubocop:disable Lint:UnusedMethodArgument + ) timer = JobHelpers::Timer.new raise_stale_job! if stale_job?(enqueued_at) @@ -35,19 +42,11 @@ def perform(result_id:, encrypted_arguments:, trace_id:, should_proof_state_id:, request_ip: request_ip, ) - callback_log_data = if dob_year_only && should_proof_state_id - proof_aamva_then_lexisnexis_dob_only( - timer: timer, - applicant_pii: applicant_pii, - dob_year_only: dob_year_only, - ) - else - proof_lexisnexis_then_aamva( - timer: timer, - applicant_pii: applicant_pii, - should_proof_state_id: should_proof_state_id, - ) - end + callback_log_data = proof_lexisnexis_then_aamva( + timer: timer, + applicant_pii: applicant_pii, + should_proof_state_id: should_proof_state_id, + ) if optional_threatmetrix_result.present? add_threatmetrix_result_to_callback_result( @@ -140,7 +139,6 @@ def proof_lexisnexis_then_aamva(timer:, applicant_pii:, should_proof_state_id:) result[:exception] = exception result[:context] = { - dob_year_only: false, should_proof_state_id: should_proof_state_id, stages: { resolution: { @@ -170,67 +168,6 @@ def proof_lexisnexis_then_aamva(timer:, applicant_pii:, should_proof_state_id:) ) end - # @return [CallbackLogData] - def proof_aamva_then_lexisnexis_dob_only(timer:, applicant_pii:, dob_year_only:) - proofer_result = timer.time('state_id') do - state_id_proofer.proof(applicant_pii) - end - - result = proofer_result.to_h - state_id_success = proofer_result.success? - resolution_success = nil - exception = proofer_result.exception.inspect if proofer_result.exception - - result[:context] = { - dob_year_only: dob_year_only, - should_proof_state_id: true, - stages: { - state_id: { - client: state_id_proofer.class.vendor_name, - errors: proofer_result.errors, - exception: exception, - success: state_id_success, - timed_out: proofer_result.timed_out?, - transaction_id: proofer_result.transaction_id, - }, - }, - } - - if state_id_success - lexisnexis_result = timer.time('resolution') do - resolution_proofer.proof(applicant_pii.merge(dob_year_only: dob_year_only)) - end - - resolution_success = lexisnexis_result.success? - exception = lexisnexis_result.exception.inspect if lexisnexis_result.exception - - result.merge!(lexisnexis_result.to_h) do |key, orig, current| - key == :messages ? orig + current : current - end - - result[:context][:stages][:resolution] = { - client: resolution_proofer.class.vendor_name, - errors: lexisnexis_result.errors, - exception: exception, - success: lexisnexis_result.success?, - timed_out: lexisnexis_result.timed_out?, - transaction_id: lexisnexis_result.transaction_id, - reference: lexisnexis_result.reference, - } - - result[:transaction_id] = lexisnexis_result.transaction_id - result[:reference] = lexisnexis_result.reference - result[:timed_out] = lexisnexis_result.timed_out? - result[:exception] = lexisnexis_result.exception.inspect if lexisnexis_result.exception - end - - CallbackLogData.new( - result: result, - resolution_success: resolution_success, - state_id_success: state_id_success, - ) - end - def proof_state_id(applicant_pii:, result:) proofer_result = state_id_proofer.proof(applicant_pii) diff --git a/app/services/idv/agent.rb b/app/services/idv/agent.rb index 57040ab9d76..c945a2987cd 100644 --- a/app/services/idv/agent.rb +++ b/app/services/idv/agent.rb @@ -21,7 +21,6 @@ def proof_resolution( job_arguments = { encrypted_arguments: encrypted_arguments, should_proof_state_id: should_proof_state_id, - dob_year_only: IdentityConfig.store.proofing_send_partial_dob, trace_id: trace_id, result_id: document_capture_session.result_id, user_id: user_id, diff --git a/app/services/proofing/lexis_nexis/instant_verify/proofer.rb b/app/services/proofing/lexis_nexis/instant_verify/proofer.rb index 4923878518d..1f396b7f0e3 100644 --- a/app/services/proofing/lexis_nexis/instant_verify/proofer.rb +++ b/app/services/proofing/lexis_nexis/instant_verify/proofer.rb @@ -15,7 +15,7 @@ class Proofer < LexisNexis::Proofer :state, :zipcode - optional_attributes :address2, :uuid_prefix, :dob_year_only + optional_attributes :address2, :uuid_prefix stage :resolution @@ -24,11 +24,7 @@ class Proofer < LexisNexis::Proofer end def send_verification_request(applicant) - VerificationRequest.new(config: config, applicant: applicant).send( - response_options: { - dob_year_only: applicant[:dob_year_only], - }, - ) + VerificationRequest.new(config: config, applicant: applicant).send end end end diff --git a/app/services/proofing/lexis_nexis/request.rb b/app/services/proofing/lexis_nexis/request.rb index 0abda758da0..8eb47dfc197 100644 --- a/app/services/proofing/lexis_nexis/request.rb +++ b/app/services/proofing/lexis_nexis/request.rb @@ -13,10 +13,7 @@ def initialize(config:, applicant:) @url = build_request_url end - # @see Response#initialize - # @param [Hash] response_options a hash of options for the Response class - # * +:dob_year_only+ - def send(response_options: {}) + def send conn = Faraday.new do |f| f.request :instrumentation, name: 'request_metric.faraday' f.request :basic_auth, config.username, config.password @@ -30,7 +27,6 @@ def send(response_options: {}) conn.post(url, body, headers) do |req| req.options.context = { service_name: metric_name } end, - **response_options, ) rescue Faraday::TimeoutError, Faraday::ConnectionFailed => e # NOTE: This is only for when Faraday is using NET::HTTP if the adapter is changed diff --git a/app/services/proofing/lexis_nexis/response.rb b/app/services/proofing/lexis_nexis/response.rb index 37bd15676d7..2373ae5e5a8 100644 --- a/app/services/proofing/lexis_nexis/response.rb +++ b/app/services/proofing/lexis_nexis/response.rb @@ -5,18 +5,11 @@ class UnexpectedHTTPStatusCodeError < StandardError; end attr_reader :response - # @param [Boolean] dob_year_only - # @see VerificationErrorParser#initialize - def initialize(response, dob_year_only: false) + def initialize(response) @response = response - @dob_year_only = dob_year_only handle_unexpected_http_status_code_error end - def dob_year_only? - @dob_year_only - end - def verification_errors return {} if verification_status == 'passed' @@ -43,10 +36,7 @@ def response_body private def verification_error_parser - @verification_error_parser ||= VerificationErrorParser.new( - response_body, - dob_year_only: dob_year_only?, - ) + @verification_error_parser ||= VerificationErrorParser.new(response_body) end def handle_unexpected_http_status_code_error diff --git a/app/services/proofing/lexis_nexis/verification_error_parser.rb b/app/services/proofing/lexis_nexis/verification_error_parser.rb index e5bc2e6aba6..665c4f5cee9 100644 --- a/app/services/proofing/lexis_nexis/verification_error_parser.rb +++ b/app/services/proofing/lexis_nexis/verification_error_parser.rb @@ -3,34 +3,18 @@ module LexisNexis class VerificationErrorParser attr_reader :body - # @param [Boolean] dob_year_only when true, only enforce that the year - # from the date of birth must match - def initialize(response_body, dob_year_only: false) + def initialize(response_body) @body = response_body - @dob_year_only = dob_year_only @product_error_messages = parse_product_error_messages @base_error_message = parse_base_error_message end - def dob_year_only? - @dob_year_only - end - def parsed_errors { base: base_error_message }.merge(product_error_messages) end def verification_status - @verification_status ||= - begin - status = body.dig('Status', 'TransactionStatus') - - if status == 'failed' && dob_year_only? && product_error_messages.empty? - 'passed' - else - status - end - end + @verification_status ||= body.dig('Status', 'TransactionStatus') end private @@ -64,19 +48,7 @@ def parse_product_error_messages products.each_with_object({}) do |product, error_messages| if product['ProductType'] == 'InstantVerify' - original_passed = (product['ProductStatus'] == 'pass') - passed_partial_dob = instant_verify_dob_year_only_pass?(product['Items']) - - Rails.logger.info( - { - name: 'lexisnexis_partial_dob', - original_passed: original_passed, - passed_partial_dob: passed_partial_dob, - partial_dob_override_enabled: dob_year_only?, - }.to_json, - ) - - next if original_passed || (dob_year_only? && passed_partial_dob) + next if product['ProductStatus'] == 'pass' elsif product['ProductStatus'] == 'pass' next end @@ -85,24 +57,6 @@ def parse_product_error_messages error_messages[key] = product end end - - # if DOBYearVerified passes, but DOBFullVerified fails, we can still allow a pass - def instant_verify_dob_year_only_pass?(items) - items ||= [] - dob_full_verified = items.find { |item| item['ItemName'] == 'DOBFullVerified' } - dob_year_verified = items.find { |item| item['ItemName'] == 'DOBYearVerified' } - other_checks = items.reject do |item| - %w[DOBYearVerified DOBFullVerified].include?(item['ItemName']) - end - - dob_full_verified.present? && - item_passed?(dob_year_verified) && - other_checks.all? { |item| item_passed?(item) } - end - - def item_passed?(item) - item && item['ItemStatus'] == 'pass' - end end end end diff --git a/app/services/proofing/mock/resolution_mock_client.rb b/app/services/proofing/mock/resolution_mock_client.rb index 1dbef3fe3a5..65ce7267cba 100644 --- a/app/services/proofing/mock/resolution_mock_client.rb +++ b/app/services/proofing/mock/resolution_mock_client.rb @@ -13,7 +13,7 @@ class ResolutionMockClient < Proofing::Base :state, :zipcode - optional_attributes :address2, :uuid_prefix, :dob_year_only + optional_attributes :address2, :uuid_prefix stage :resolution diff --git a/config/application.yml.default b/config/application.yml.default index a0c7ce40175..e24bbe46a35 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -205,7 +205,6 @@ poll_rate_for_verify_in_seconds: 3 proofer_mock_fallback: true proofing_device_profiling_collecting_enabled: false proofing_device_profiling_decisioning_enabled: false -proofing_send_partial_dob: false proof_address_max_attempts: 5 proof_address_max_attempt_window_in_minutes: 360 proof_ssn_max_attempts: 10 diff --git a/lib/identity_config.rb b/lib/identity_config.rb index e8dc7d733c2..3756244c6fd 100644 --- a/lib/identity_config.rb +++ b/lib/identity_config.rb @@ -293,7 +293,6 @@ def self.build_store(config_map) config.add(:proofer_mock_fallback, type: :boolean) config.add(:proofing_device_profiling_collecting_enabled, type: :boolean) config.add(:proofing_device_profiling_decisioning_enabled, type: :boolean) - 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) config.add(:proof_ssn_max_attempts, type: :integer) diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb index 9a5ee7c1a59..24c31ffb2ff 100644 --- a/spec/features/idv/analytics_spec.rb +++ b/spec/features/idv/analytics_spec.rb @@ -29,7 +29,7 @@ 'IdV: doc auth verify visited' => { flow_path: 'standard', step: 'verify', step_count: 1 }, 'IdV: doc auth verify submitted' => { success: true, errors: {}, flow_path: 'standard', step: 'verify', step_count: 1 }, 'IdV: doc auth verify_wait visited' => { flow_path: 'standard', step: 'verify_wait', step_count: 1 }, - 'IdV: doc auth optional verify_wait submitted' => { success: true, errors: {}, address_edited: false, proofing_results: { messages: [], exception: nil, transaction_id: 'resolution-mock-transaction-id-123', reference: 'aaa-bbb-ccc', timed_out: false, context: { dob_year_only: false, should_proof_state_id: true, stages: { resolution: { client: 'ResolutionMock', errors: {}, exception: nil, success: true, timed_out: false, transaction_id: 'resolution-mock-transaction-id-123', reference: 'aaa-bbb-ccc' }, state_id: { client: 'StateIdMock', errors: {}, success: true, timed_out: false, exception: nil, transaction_id: 'state-id-mock-transaction-id-456', state: 'MT', state_id_jurisdiction: 'ND' } } } }, ssn_is_unique: true, step: 'verify_wait_step_show' }, + 'IdV: doc auth optional verify_wait submitted' => { success: true, errors: {}, address_edited: false, proofing_results: { messages: [], exception: nil, transaction_id: 'resolution-mock-transaction-id-123', reference: 'aaa-bbb-ccc', timed_out: false, context: { should_proof_state_id: true, stages: { resolution: { client: 'ResolutionMock', errors: {}, exception: nil, success: true, timed_out: false, transaction_id: 'resolution-mock-transaction-id-123', reference: 'aaa-bbb-ccc' }, state_id: { client: 'StateIdMock', errors: {}, success: true, timed_out: false, exception: nil, transaction_id: 'state-id-mock-transaction-id-456', state: 'MT', state_id_jurisdiction: 'ND' } } } }, ssn_is_unique: true, step: 'verify_wait_step_show' }, 'IdV: phone of record visited' => {}, 'IdV: phone confirmation form' => { success: true, errors: {}, phone_type: :mobile, types: [:fixed_or_mobile], carrier: 'Test Mobile Carrier', country_code: 'US', area_code: '202' }, 'IdV: phone confirmation vendor' => { success: true, errors: {}, vendor: { messages: [], exception: nil, context: { stages: [{ address: 'AddressMock' }] }, transaction_id: 'address-mock-transaction-id-123', timed_out: false }, new_phone_added: false }, @@ -70,7 +70,7 @@ 'IdV: doc auth verify visited' => { flow_path: 'standard', step: 'verify', step_count: 1 }, 'IdV: doc auth verify submitted' => { success: true, errors: {}, flow_path: 'standard', step: 'verify', step_count: 1 }, 'IdV: doc auth verify_wait visited' => { flow_path: 'standard', step: 'verify_wait', step_count: 1 }, - 'IdV: doc auth optional verify_wait submitted' => { success: true, errors: {}, address_edited: false, proofing_results: { messages: [], exception: nil, transaction_id: 'resolution-mock-transaction-id-123', reference: 'aaa-bbb-ccc', timed_out: false, context: { dob_year_only: false, should_proof_state_id: true, stages: { resolution: { client: 'ResolutionMock', errors: {}, exception: nil, success: true, timed_out: false, transaction_id: 'resolution-mock-transaction-id-123', reference: 'aaa-bbb-ccc' }, state_id: { client: 'StateIdMock', errors: {}, success: true, timed_out: false, exception: nil, transaction_id: 'state-id-mock-transaction-id-456', state: 'MT', state_id_jurisdiction: 'ND' } } } }, ssn_is_unique: true, step: 'verify_wait_step_show' }, + 'IdV: doc auth optional verify_wait submitted' => { success: true, errors: {}, address_edited: false, proofing_results: { messages: [], exception: nil, transaction_id: 'resolution-mock-transaction-id-123', reference: 'aaa-bbb-ccc', timed_out: false, context: { should_proof_state_id: true, stages: { resolution: { client: 'ResolutionMock', errors: {}, exception: nil, success: true, timed_out: false, transaction_id: 'resolution-mock-transaction-id-123', reference: 'aaa-bbb-ccc' }, state_id: { client: 'StateIdMock', errors: {}, success: true, timed_out: false, exception: nil, transaction_id: 'state-id-mock-transaction-id-456', state: 'MT', state_id_jurisdiction: 'ND' } } } }, ssn_is_unique: true, step: 'verify_wait_step_show' }, 'IdV: phone of record visited' => {}, 'IdV: USPS address letter requested' => { enqueued_at: Time.zone.now }, } diff --git a/spec/fixtures/proofing/lexis_nexis/instant_verify/year_of_birth_fail_response.json b/spec/fixtures/proofing/lexis_nexis/instant_verify/year_of_birth_fail_response.json index 0815b257c62..ee8614e36e8 100644 --- a/spec/fixtures/proofing/lexis_nexis/instant_verify/year_of_birth_fail_response.json +++ b/spec/fixtures/proofing/lexis_nexis/instant_verify/year_of_birth_fail_response.json @@ -48,10 +48,6 @@ "ItemName": "DOBYearVerified", "ItemStatus": "pass" }, - { - "ItemName": "SSNLowIssuance", - "ItemStatus": "pass" - }, { "ItemName": "LexIDDeathMatch", "ItemStatus": "pass" diff --git a/spec/jobs/resolution_proofing_job_spec.rb b/spec/jobs/resolution_proofing_job_spec.rb index 50abbefee1e..2ff8246c433 100644 --- a/spec/jobs/resolution_proofing_job_spec.rb +++ b/spec/jobs/resolution_proofing_job_spec.rb @@ -23,7 +23,6 @@ ) end let(:document_capture_session) { DocumentCaptureSession.new(result_id: SecureRandom.hex) } - let(:dob_year_only) { false } let(:should_proof_state_id) { true } let(:lexisnexis_transaction_id) { SecureRandom.uuid } @@ -49,7 +48,6 @@ ResolutionProofingJob.perform_later( result_id: document_capture_session.result_id, should_proof_state_id: should_proof_state_id, - dob_year_only: dob_year_only, encrypted_arguments: encrypted_arguments, trace_id: trace_id, user_id: user.id, @@ -69,7 +67,6 @@ instance.perform( result_id: document_capture_session.result_id, should_proof_state_id: should_proof_state_id, - dob_year_only: dob_year_only, encrypted_arguments: encrypted_arguments, trace_id: trace_id, user_id: user.id, @@ -118,8 +115,6 @@ } end - let(:dob_year_only) { false } - it 'returns results and adds threatmetrix proofing components' do perform @@ -132,7 +127,6 @@ success: true, timed_out: false, context: { - dob_year_only: dob_year_only, should_proof_state_id: true, stages: { resolution: { @@ -170,8 +164,7 @@ expect(proofing_component.threatmetrix_review_status).to eq('pass') end - context 'dob_year_only, failed response from lexisnexis' do - let(:dob_year_only) { true } + context 'failed response from lexisnexis' do let(:should_proof_state_id) { true } let(:lexisnexis_response) do { @@ -213,17 +206,8 @@ success: false, timed_out: false, context: { - dob_year_only: dob_year_only, should_proof_state_id: true, stages: { - state_id: { - client: Proofing::Aamva::Proofer.vendor_name, - errors: {}, - exception: nil, - success: true, - timed_out: false, - transaction_id: aamva_transaction_id, - }, resolution: { client: Proofing::LexisNexis::InstantVerify::Proofer.vendor_name, errors: { @@ -328,79 +312,6 @@ perform end end - - context 'checking DOB year only' do - let(:dob_year_only) { true } - - it 'only sends the birth year to LexisNexis (extra applicant attribute)' do - expect(state_id_proofer).to receive(:proof).and_return(Proofing::Result.new) - expect(resolution_proofer).to receive(:proof). - with(hash_including(dob_year_only: true)). - and_return(Proofing::Result.new) - - perform - end - - it 'does not check LexisNexis when AAMVA proofing does not match' do - expect(state_id_proofer).to receive(:proof). - and_return(Proofing::Result.new(exception: 'error')) - expect(resolution_proofer).to_not receive(:proof) - - perform - end - - it 'logs the correct context' do - expect(state_id_proofer).to receive(:proof). - and_return(Proofing::Result.new(transaction_id: aamva_transaction_id)) - expect(resolution_proofer).to receive(:proof).and_return( - Proofing::Result.new( - transaction_id: lexisnexis_transaction_id, - reference: lexisnexis_reference, - ), - ) - - perform - - result = document_capture_session.load_proofing_result[:result] - - expect(result[:context]).to eq( - { - dob_year_only: dob_year_only, - should_proof_state_id: true, - stages: { - state_id: { - client: 'aamva:state_id', - errors: {}, - exception: nil, - success: true, - timed_out: false, - transaction_id: aamva_transaction_id, - }, - resolution: { - client: 'lexisnexis:instant_verify', - errors: {}, - exception: nil, - success: true, - timed_out: false, - transaction_id: lexisnexis_transaction_id, - reference: lexisnexis_reference, - }, - threatmetrix: { - client: Proofing::Mock::DdpMockClient.vendor_name, - errors: {}, - exception: nil, - success: true, - timed_out: false, - transaction_id: threatmetrix_request_id, - }, - }, - }, - ) - - expect(result.dig(:transaction_id)).to eq(lexisnexis_transaction_id) - expect(result.dig(:reference)).to eq(lexisnexis_reference) - end - end end context 'a stale job' do diff --git a/spec/services/proofing/lexis_nexis/instant_verify/proofing_spec.rb b/spec/services/proofing/lexis_nexis/instant_verify/proofing_spec.rb index 8438a169043..59de75db66a 100644 --- a/spec/services/proofing/lexis_nexis/instant_verify/proofing_spec.rb +++ b/spec/services/proofing/lexis_nexis/instant_verify/proofing_spec.rb @@ -55,86 +55,33 @@ end describe '#proof' do - subject(:result) { instance.proof(applicant) } - let(:applicant) { super().merge(dob_year_only: dob_year_only) } - before do stub_request(:post, verification_request.url). to_return(body: response_body, status: 200) end - context 'when dob_year_only is false' do - let(:dob_year_only) { false } - - context 'when the response is a full match' do - let(:response_body) { LexisNexisFixtures.instant_verify_success_response_json } - - it 'is a successful result' do - expect(result.success?).to eq(true) - expect(result.errors).to be_empty - end - end - - context 'when the response is a year-of-birth failure only' do - let(:response_body) { LexisNexisFixtures.instant_verify_year_of_birth_fail_response_json } - - it 'is a failure result' do - expect(result.success?).to eq(false) - expect(result.errors).to include( - base: include(a_kind_of(String)), - 'Execute Instant Verify': include(a_kind_of(Hash)), - ) - end - end + context 'when the response is a full match' do + let(:response_body) { LexisNexisFixtures.instant_verify_success_response_json } - context 'when the response is a year-of-birth failure and a date-of-birth failure' do - let(:response_body) do - LexisNexisFixtures.instant_verify_date_of_birth_full_fail_response_json - end + it 'is a successful result' do + result = subject.proof(applicant) - it 'is a failure result' do - expect(result.success?).to eq(false) - expect(result.errors).to include( - base: include(a_kind_of(String)), - 'Execute Instant Verify': include(a_kind_of(Hash)), - ) - end + expect(result.success?).to eq(true) + expect(result.errors).to be_empty end end - context 'when dob_year_only is true' do - let(:dob_year_only) { true } + context 'when the response is a not a full match' do + let(:response_body) { LexisNexisFixtures.instant_verify_year_of_birth_fail_response_json } - context 'when the response is a full match' do - let(:response_body) { LexisNexisFixtures.instant_verify_success_response_json } + it 'is a failure result' do + result = subject.proof(applicant) - it 'is a successful result' do - expect(result.success?).to eq(true) - expect(result.errors).to be_empty - end - end - - context 'when the response is a year-of-birth failure only' do - let(:response_body) { LexisNexisFixtures.instant_verify_year_of_birth_fail_response_json } - - it 'is a successful result' do - expect(result.errors).to be_empty - expect(result.success?).to eq(true) - end - end - - context 'when the response is a year-of-birth failure and a date-of-birth failure' do - let(:response_body) do - LexisNexisFixtures.instant_verify_date_of_birth_full_fail_response_json - end - - it 'is a failure result' do - expect(result.success?).to eq(false) - expect(result.errors).to include( - base: include(a_kind_of(String)), - 'Execute Instant Verify': include(a_kind_of(Hash)), - ) - end + expect(result.success?).to eq(false) + expect(result.errors).to include( + base: include(a_kind_of(String)), + 'Execute Instant Verify': include(a_kind_of(Hash)), + ) end end end diff --git a/spec/services/proofing/lexis_nexis/verification_error_parser_spec.rb b/spec/services/proofing/lexis_nexis/verification_error_parser_spec.rb index 634c6eeb3fd..2ed093b22ab 100644 --- a/spec/services/proofing/lexis_nexis/verification_error_parser_spec.rb +++ b/spec/services/proofing/lexis_nexis/verification_error_parser_spec.rb @@ -8,19 +8,6 @@ let(:response_body) do JSON.parse(LexisNexisFixtures.instant_verify_year_of_birth_fail_response_json) end - - it 'logs a message formatted as JSON' do - expect(Rails.logger).to receive(:info) do |arg| - expect(JSON.parse(arg, symbolize_names: true)).to eq( - name: 'lexisnexis_partial_dob', - original_passed: false, - passed_partial_dob: true, - partial_dob_override_enabled: false, - ) - end - - expect(error_parser).to be - end end describe '#parsed_errors' do @@ -33,90 +20,4 @@ expect(errors[:InstantVerify]).to eq(response_body['Products'][2]) end end - - describe '#instant_verify_dob_year_only_pass?' do - subject(:dob_year_only_pass) do - error_parser.send(:instant_verify_dob_year_only_pass?, items) - end - - context 'with both DOBYearVerified and DOBFullVerified passing' do - let(:items) do - [ - { 'ItemName' => 'DOBYearVerified', 'ItemStatus' => 'pass' }, - { 'ItemName' => 'DOBFullVerified', 'ItemStatus' => 'pass' }, - { 'ItemName' => 'SomeOtherProduct', 'ItemStatus' => 'pass' }, - ] - end - it { is_expected.to eq(true) } - end - - context 'with both DOBYearVerified and DOBFullVerified passing' do - let(:items) do - [ - { 'ItemName' => 'DOBYearVerified', 'ItemStatus' => 'pass' }, - { 'ItemName' => 'DOBFullVerified', 'ItemStatus' => 'pass' }, - { 'ItemName' => 'SomeOtherProduct', 'ItemStatus' => 'pass' }, - ] - end - it { is_expected.to eq(true) } - end - - context 'with both DOBYearVerified and DOBFullVerified passing, some other product failing' do - let(:items) do - [ - { 'ItemName' => 'DOBYearVerified', 'ItemStatus' => 'pass' }, - { 'ItemName' => 'DOBFullVerified', 'ItemStatus' => 'pass' }, - { 'ItemName' => 'SomeOtherProduct', 'ItemStatus' => 'fail' }, - ] - end - it { is_expected.to be_falsey } - end - - context 'with both DOBYearVerified passed, and DOBFullVerified failing' do - let(:items) do - [ - { 'ItemName' => 'DOBYearVerified', 'ItemStatus' => 'pass' }, - { 'ItemName' => 'DOBFullVerified', 'ItemStatus' => 'fail' }, - { 'ItemName' => 'SomeOtherProduct', 'ItemStatus' => 'pass' }, - ] - end - it { is_expected.to eq(true) } - end - - context 'with DOBYearVerified passed and DOBFullVerified failing, some other product failing' do - let(:items) do - [ - { 'ItemName' => 'DOBYearVerified', 'ItemStatus' => 'pass' }, - { 'ItemName' => 'DOBFullVerified', 'ItemStatus' => 'fail' }, - { 'ItemName' => 'SomeOtherProduct', 'ItemStatus' => 'fail' }, - ] - end - it { is_expected.to be_falsey } - end - - context 'with DOBYearVerified missing and DOBFullVerified passing' do - let(:items) do - [ - { 'ItemName' => 'DOBFullVerified', 'ItemStatus' => 'pass' }, - { 'ItemName' => 'SomeOtherProduct', 'ItemStatus' => 'pass' }, - ] - end - it { is_expected.to be_falsey } - end - - context 'with DOBYearVerified passing and DOBFullVerified missing' do - let(:items) do - [ - { 'ItemName' => 'DOBYearVerified', 'ItemStatus' => 'pass' }, - { 'ItemName' => 'SomeOtherProduct', 'ItemStatus' => 'pass' }, - ] - end - it { is_expected.to be_falsey } - end - - context 'with a nil Items array' do - let(:items) { nil } - it { is_expected.to be_falsey } - end - end end