diff --git a/lib/who_need_help/external_boundary_drill.ex b/lib/who_need_help/external_boundary_drill.ex index 131d801..41badf5 100644 --- a/lib/who_need_help/external_boundary_drill.ex +++ b/lib/who_need_help/external_boundary_drill.ex @@ -513,6 +513,10 @@ defmodule WhoNeedHelp.ExternalBoundaryDrill do acceptance_key = "request-accepted:#{assignment.id}:#{requester.id}" acceptance_job = wait_for_completed_job!(acceptance_key, 1) + + acceptance_record = + Repo.get_by!(WhoNeedHelp.Notifications.Notification, idempotency_key: acceptance_key) + acceptance_state = state!(base_url)["push"] assert!(acceptance_job.attempt == 1, "acceptance push was not completed on its first job run") @@ -531,11 +535,16 @@ defmodule WhoNeedHelp.ExternalBoundaryDrill do "acceptance product event targeted the wrong user" ) - {:ok, replay_job} = + {:ok, replay_notification} = Push.enqueue_request_accepted(assignment.id, request.id, requester.id) - assert!(replay_job.conflict?, "product event replay created a new Oban job") - assert!(replay_job.id == acceptance_job.id, "product event replay returned another job") + assert!( + replay_notification.id == acceptance_record.id, + "product event replay created another notification" + ) + + replay_job = wait_for_completed_job!(acceptance_key, 1) + assert!(replay_job.id == acceptance_job.id, "product event replay created another Oban job") Process.sleep(250) acceptance_replay_state = state!(base_url)["push"]