2022-08-05 22:31:36 -06:00
|
|
|
# Pleroma: A lightweight social networking server
|
2023-01-01 04:11:47 -07:00
|
|
|
# Copyright © 2017-2023 Pleroma Authors <https://pleroma.social/>
|
2022-08-05 22:31:36 -06:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
defmodule Pleroma.Workers.ReceiverWorkerTest do
|
|
|
|
use Pleroma.DataCase, async: true
|
|
|
|
use Oban.Testing, repo: Pleroma.Repo
|
|
|
|
|
|
|
|
import Mock
|
|
|
|
import Pleroma.Factory
|
|
|
|
|
|
|
|
alias Pleroma.Workers.ReceiverWorker
|
|
|
|
|
|
|
|
test "it ignores MRF reject" do
|
|
|
|
params = insert(:note).data
|
|
|
|
|
|
|
|
with_mock Pleroma.Web.ActivityPub.Transmogrifier,
|
|
|
|
handle_incoming: fn _ -> {:reject, "MRF"} end do
|
|
|
|
assert {:cancel, "MRF"} =
|
|
|
|
ReceiverWorker.perform(%Oban.Job{
|
|
|
|
args: %{"op" => "incoming_ap_doc", "params" => params}
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|