Skip to content

Commit

Permalink
Fixed a failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshingYou1 committed Sep 6, 2024
1 parent 6a19448 commit 163582a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion spec/lib/form1010_ezr/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.'
)
Expand Down

0 comments on commit 163582a

Please sign in to comment.