summaryrefslogtreecommitdiff
path: root/test/web/activity_pub/relay_test.exs
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2019-09-16 07:34:22 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2019-09-16 07:34:22 +0300
commitd75bc728e7e309174373e234079aa4825c81ab3e (patch)
tree1ac6b44f5758ff028103c37d3712520f45a0695e /test/web/activity_pub/relay_test.exs
parent4f548cb2b7b4a16a956a4f4a0ff64d279777925e (diff)
parent2990c0a53b14646eab19b57d068ac8aa7e17ea4e (diff)
downloadpleroma-d75bc728e7e309174373e234079aa4825c81ab3e.tar.gz
pleroma-d75bc728e7e309174373e234079aa4825c81ab3e.zip
Merge branch 'develop' into issue/733
Diffstat (limited to 'test/web/activity_pub/relay_test.exs')
-rw-r--r--test/web/activity_pub/relay_test.exs17
1 files changed, 12 insertions, 5 deletions
diff --git a/test/web/activity_pub/relay_test.exs b/test/web/activity_pub/relay_test.exs
index 4f7d592a6..7315dce26 100644
--- a/test/web/activity_pub/relay_test.exs
+++ b/test/web/activity_pub/relay_test.exs
@@ -10,6 +10,7 @@ defmodule Pleroma.Web.ActivityPub.RelayTest do
alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.Web.ActivityPub.Relay
+ import ExUnit.CaptureLog
import Pleroma.Factory
import Mock
@@ -20,7 +21,9 @@ defmodule Pleroma.Web.ActivityPub.RelayTest do
describe "follow/1" do
test "returns errors when user not found" do
- assert Relay.follow("test-ap-id") == {:error, "Could not fetch by AP id"}
+ assert capture_log(fn ->
+ assert Relay.follow("test-ap-id") == {:error, "Could not fetch by AP id"}
+ end) =~ "Could not fetch by AP id"
end
test "returns activity" do
@@ -37,7 +40,9 @@ defmodule Pleroma.Web.ActivityPub.RelayTest do
describe "unfollow/1" do
test "returns errors when user not found" do
- assert Relay.unfollow("test-ap-id") == {:error, "Could not fetch by AP id"}
+ assert capture_log(fn ->
+ assert Relay.unfollow("test-ap-id") == {:error, "Could not fetch by AP id"}
+ end) =~ "Could not fetch by AP id"
end
test "returns activity" do
@@ -78,7 +83,9 @@ defmodule Pleroma.Web.ActivityPub.RelayTest do
}
)
- assert Relay.publish(activity) == {:error, nil}
+ assert capture_log(fn ->
+ assert Relay.publish(activity) == {:error, nil}
+ end) =~ "[error] error: nil"
end
test_with_mock "returns announce activity and publish to federate",
@@ -92,7 +99,7 @@ defmodule Pleroma.Web.ActivityPub.RelayTest do
assert activity.data["type"] == "Announce"
assert activity.data["actor"] == service_actor.ap_id
assert activity.data["object"] == obj.data["id"]
- assert called(Pleroma.Web.Federator.publish(activity, 5))
+ assert called(Pleroma.Web.Federator.publish(activity))
end
test_with_mock "returns announce activity and not publish to federate",
@@ -106,7 +113,7 @@ defmodule Pleroma.Web.ActivityPub.RelayTest do
assert activity.data["type"] == "Announce"
assert activity.data["actor"] == service_actor.ap_id
assert activity.data["object"] == obj.data["id"]
- refute called(Pleroma.Web.Federator.publish(activity, 5))
+ refute called(Pleroma.Web.Federator.publish(activity))
end
end
end