summaryrefslogtreecommitdiff
path: root/test/web/salmon
diff options
context:
space:
mode:
authorlambda <lain@soykaf.club>2019-05-13 18:58:04 +0000
committerlambda <lain@soykaf.club>2019-05-13 18:58:04 +0000
commitb14a314ce7e8f2a8803c69329978e26939a40ee4 (patch)
tree0cd18222c915a121c3b52ed56bbc28547d5561e5 /test/web/salmon
parentf3e8f5b1f208b10130c7123e68af1e38575f180b (diff)
parent44b182732efe2d8571aa54e6062637e7e42021ce (diff)
downloadpleroma-b14a314ce7e8f2a8803c69329978e26939a40ee4.tar.gz
pleroma-b14a314ce7e8f2a8803c69329978e26939a40ee4.zip
Merge branch 'feature/federator-behaviours' into 'develop'
federator modularization (outgoing) See merge request pleroma/pleroma!1140
Diffstat (limited to 'test/web/salmon')
-rw-r--r--test/web/salmon/salmon_test.exs13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/web/salmon/salmon_test.exs b/test/web/salmon/salmon_test.exs
index 7532578ca..232082779 100644
--- a/test/web/salmon/salmon_test.exs
+++ b/test/web/salmon/salmon_test.exs
@@ -7,7 +7,9 @@ defmodule Pleroma.Web.Salmon.SalmonTest do
alias Pleroma.Activity
alias Pleroma.Repo
alias Pleroma.User
+ alias Pleroma.Web.Federator.Publisher
alias Pleroma.Web.Salmon
+ import Mock
import Pleroma.Factory
@magickey "RSA.pu0s-halox4tu7wmES1FVSx6u-4wc0YrUFXcqWXZG4-27UmbCOpMQftRCldNRfyA-qLbz-eqiwQhh-1EwUvjsD4cYbAHNGHwTvDOyx5AKthQUP44ykPv7kjKGh3DWKySJvcs9tlUG87hlo7AvnMo9pwRS_Zz2CacQ-MKaXyDepk=.AQAB"
@@ -77,7 +79,10 @@ defmodule Pleroma.Web.Salmon.SalmonTest do
"RSA.uzg6r1peZU0vXGADWxGJ0PE34WvmhjUmydbX5YYdOiXfODVLwCMi1umGoqUDm-mRu4vNEdFBVJU1CpFA7dKzWgIsqsa501i2XqElmEveXRLvNRWFB6nG03Q5OUY2as8eE54BJm0p20GkMfIJGwP6TSFb-ICp3QjzbatuSPJ6xCE=.AQAB"
end
- test "it pushes an activity to remote accounts it's addressed to" do
+ test_with_mock "it pushes an activity to remote accounts it's addressed to",
+ Publisher,
+ [:passthrough],
+ [] do
user_data = %{
info: %{
salmon: "http://test-example.org/salmon"
@@ -102,10 +107,8 @@ defmodule Pleroma.Web.Salmon.SalmonTest do
user = User.get_cached_by_ap_id(activity.data["actor"])
{:ok, user} = Pleroma.Web.WebFinger.ensure_keys_present(user)
- poster = fn url, _data, _headers ->
- assert url == "http://test-example.org/salmon"
- end
+ Salmon.publish(user, activity)
- Salmon.publish(user, activity, poster)
+ assert called(Publisher.enqueue_one(Salmon, %{recipient: mentioned_user}))
end
end