Merge pull request 'fix flaky test_user_relationship_test.exs:81' (#240) from ilja...
[akkoma] / test / pleroma / workers / receiver_worker_test.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Workers.ReceiverWorkerTest do
6 use Pleroma.DataCase, async: true
7 use Oban.Testing, repo: Pleroma.Repo
8
9 import Mock
10 import Pleroma.Factory
11
12 alias Pleroma.Workers.ReceiverWorker
13
14 test "it ignores MRF reject" do
15 params = insert(:note).data
16
17 with_mock Pleroma.Web.ActivityPub.Transmogrifier,
18 handle_incoming: fn _ -> {:reject, "MRF"} end do
19 assert {:discard, "MRF"} =
20 ReceiverWorker.perform(%Oban.Job{
21 args: %{"op" => "incoming_ap_doc", "params" => params}
22 })
23 end
24 end
25 end