From 163582a160c24f0169138c96e17e26fcb3678d01 Mon Sep 17 00:00:00 2001 From: Joshua Drumm Date: Fri, 6 Sep 2024 14:49:03 -0400 Subject: [PATCH] Fixed a failing test --- spec/lib/form1010_ezr/service_spec.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/spec/lib/form1010_ezr/service_spec.rb b/spec/lib/form1010_ezr/service_spec.rb index 9c6a3f2b02f..46380c70520 100644 --- a/spec/lib/form1010_ezr/service_spec.rb +++ b/spec/lib/form1010_ezr/service_spec.rb @@ -165,6 +165,15 @@ def expect_personal_info_log(message) end describe '#log_submission_failure' do + context "when 'parsed_form' is not present" do + it 'only increments StatsD' do + allow(StatsD).to receive(:increment) + expect(StatsD).to receive(:increment).with('api.1010ezr.failed') + + described_class.new(nil).log_submission_failure(nil) + end + end + context "when 'parsed_form' is present" do context "when 'retries_exhausted' is false" do it "increments StatsD, creates a 'PersonalInformationLog' record, and logs a failure message to sentry" do @@ -316,7 +325,7 @@ def expect_personal_info_log(message) it 'increments StatsD as well as logs and raises the error' do allow(StatsD).to receive(:increment) - expect(StatsD).to receive(:increment).with('api.1010ezr.failed_wont_retry') + expect(StatsD).to receive(:increment).with('api.1010ezr.failed') expect { submit_form(form) }.to raise_error( StandardError, 'Uh oh. Some bad error occurred.' )