From: Ivan Tashkinov Date: Fri, 9 Aug 2019 17:09:56 +0000 (+0300) Subject: Merge remote-tracking branch 'remotes/upstream/develop' into 1149-oban-job-queue X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=267262491ecf7b413052708062abac69b1d8f643;p=akkoma Merge remote-tracking branch 'remotes/upstream/develop' into 1149-oban-job-queue --- 267262491ecf7b413052708062abac69b1d8f643 diff --cc test/web/federator_test.exs index ebe962da2,73cfaa8f1..d3a28d50e --- a/test/web/federator_test.exs +++ b/test/web/federator_test.exs @@@ -235,8 -227,23 +235,24 @@@ defmodule Pleroma.Web.FederatorTest d "to" => ["https://www.w3.org/ns/activitystreams#Public"] } - :error = Federator.incoming_ap_doc(params) + assert {:ok, job} = Federator.incoming_ap_doc(params) + assert :error = ObanHelpers.perform(job) end + + test "it does not crash if MRF rejects the post" do + policies = Pleroma.Config.get([:instance, :rewrite_policy]) + mrf_keyword_policy = Pleroma.Config.get(:mrf_keyword) + Pleroma.Config.put([:mrf_keyword, :reject], ["lain"]) + Pleroma.Config.put([:instance, :rewrite_policy], Pleroma.Web.ActivityPub.MRF.KeywordPolicy) + + params = + File.read!("test/fixtures/mastodon-post-activity.json") + |> Poison.decode!() + + assert Federator.incoming_ap_doc(params) == :error + + Pleroma.Config.put([:instance, :rewrite_policy], policies) + Pleroma.Config.put(:mrf_keyword, mrf_keyword_policy) + end end end