Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/services/proofing/resolution/progressive_proofer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def proof_id_with_aamva_if_needed
timer.time('state_id') do
state_id_proofer.proof(applicant_pii_with_state_id_address)
end.tap do |result|
add_sp_cost(:aamva, result.transaction_id)
add_sp_cost(:aamva, result.transaction_id) if !result.exception.present?
Comment thread
jmhooper marked this conversation as resolved.
Outdated
end
end

Expand Down
20 changes: 20 additions & 0 deletions spec/services/proofing/resolution/progressive_proofer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
Proofing::StateIdResult,
success?: false,
transaction_id: 'aamva-123',
exception: nil,
)
end
let(:aamva_proofer) { instance_double(Proofing::Aamva::Proofer, proof: aamva_proofer_result) }
Expand Down Expand Up @@ -202,6 +203,21 @@ def block_real_instant_verify_requests
expect(threatmetrix_sp_costs.count).to eq(0)
end
end

context 'AAMVA raises an exception' do
let(:aamva_proofer_result) do
instance_double(
Proofing::StateIdResult,
success?: false,
transaction_id: 'aamva-123',
exception: RuntimeError.new('this is a fun test error!!'),
)
end

it 'does not track an SP cost for AAMVA' do
expect { proof }.to_not change { SpCost.where(cost_type: :aamva).count }
end
end
end

context 'ipp flow' do
Expand Down Expand Up @@ -279,6 +295,7 @@ def block_real_instant_verify_requests
verified_attributes: [],
success?: false,
transaction_id: 'aamva-123',
exception: nil,
)
end

Expand All @@ -294,6 +311,7 @@ def block_real_instant_verify_requests
verified_attributes: [:address],
success?: true,
transaction_id: 'aamva-123',
exception: nil,
)
end

Expand Down Expand Up @@ -332,6 +350,7 @@ def block_real_instant_verify_requests
Proofing::StateIdResult,
success?: false,
transaction_id: 'aamva-123',
exception: nil,
)
end

Expand Down Expand Up @@ -413,6 +432,7 @@ def block_real_instant_verify_requests
Proofing::StateIdResult,
success?: false,
transaction_id: 'aamva-123',
exception: nil,
)
end

Expand Down