2022-08-08 15:47:57 +00:00
|
|
|
# Pleroma: A lightweight social networking server
|
|
|
|
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
defmodule Pleroma.Workers.ReceiverWorkerTest do
|
2023-08-01 10:43:50 +00:00
|
|
|
use Pleroma.DataCase, async: false
|
2022-08-08 15:47:57 +00:00
|
|
|
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
|
2022-08-11 18:21:43 +00:00
|
|
|
assert {:discard, "MRF"} =
|
2022-08-08 15:47:57 +00:00
|
|
|
ReceiverWorker.perform(%Oban.Job{
|
|
|
|
args: %{"op" => "incoming_ap_doc", "params" => params}
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|