From 497acdaafc36394b9d44e6f76050ad24bc4b9a0b Mon Sep 17 00:00:00 2001 From: Matthew Thornton Date: Mon, 17 Jun 2024 23:05:44 -0400 Subject: [PATCH] Fix flaky test --- spec/jobs/hearings/receive_notification_job_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/jobs/hearings/receive_notification_job_spec.rb b/spec/jobs/hearings/receive_notification_job_spec.rb index 0ed8049697a..f9b22d3fef8 100644 --- a/spec/jobs/hearings/receive_notification_job_spec.rb +++ b/spec/jobs/hearings/receive_notification_job_spec.rb @@ -124,9 +124,10 @@ context ".perform" do # create notification event record let(:hearing_scheduled_event) do - create(:notification_event, event_type: Constants.EVENT_TYPE_FILTERS.hearing_scheduled, - email_template_id: "27bf814b-f065-4fc8-89af-ae1292db894e", - sms_template_id: "c2798da3-4c7a-43ed-bc16-599329eaf7cc") + NotificationEvent.find_by_event_type(Constants.EVENT_TYPE_FILTERS.hearing_scheduled) || + create(:notification_event, event_type: Constants.EVENT_TYPE_FILTERS.hearing_scheduled, + email_template_id: "27bf814b-f065-4fc8-89af-ae1292db894e", + sms_template_id: "c2798da3-4c7a-43ed-bc16-599329eaf7cc") end # create notification record let(:notification) do