summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2024-03-17 13:38:59 +0000
committerlain <lain@soykaf.club>2024-03-17 13:38:59 +0000
commit56e456fb5be371c6bfae3ed5f320f8f7e228131e (patch)
treefb122be9531219c39fea93f59eac37d1318c38f7 /test
parent95bcd5d28f0679dc0c9443aa21d215376abb5a4e (diff)
parentcaf855cf9cb9a5cadd2519237c9e7916007f4850 (diff)
downloadpleroma-56e456fb5be371c6bfae3ed5f320f8f7e228131e.tar.gz
pleroma-56e456fb5be371c6bfae3ed5f320f8f7e228131e.zip
Merge branch 'fix-3241' into 'develop'
Consider a case when users.inbox is nil (Fix 3241) Closes #3241 See merge request pleroma/pleroma!4083
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/activity_pub/publisher_test.exs12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/pleroma/web/activity_pub/publisher_test.exs b/test/pleroma/web/activity_pub/publisher_test.exs
index 7aa06a5c4..870f1f77a 100644
--- a/test/pleroma/web/activity_pub/publisher_test.exs
+++ b/test/pleroma/web/activity_pub/publisher_test.exs
@@ -25,6 +25,17 @@ defmodule Pleroma.Web.ActivityPub.PublisherTest do
setup_all do: clear_config([:instance, :federating], true)
+ describe "should_federate?/1" do
+ test "it returns false when the inbox is nil" do
+ refute Publisher.should_federate?(nil, false)
+ refute Publisher.should_federate?(nil, true)
+ end
+
+ test "it returns true when public is true" do
+ assert Publisher.should_federate?(false, true)
+ end
+ end
+
describe "gather_webfinger_links/1" do
test "it returns links" do
user = insert(:user)
@@ -205,6 +216,7 @@ defmodule Pleroma.Web.ActivityPub.PublisherTest do
refute called(Instances.set_reachable(inbox))
end
+ @tag capture_log: true
test_with_mock "calls `Instances.set_unreachable` on target inbox on non-2xx HTTP response code",
Instances,
[:passthrough],