projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Transmogrifier: Correctly save incoming ids for Accept/Reject.
[akkoma]
/
test
/
web
/
activity_pub
/
publisher_test.exs
diff --git
a/test/web/activity_pub/publisher_test.exs
b/test/web/activity_pub/publisher_test.exs
index 32b7a242c7470472ad579cadd500ccf0a841fca2..df03b40087aa708036eb6568f2a58522b899e150 100644
(file)
--- a/
test/web/activity_pub/publisher_test.exs
+++ b/
test/web/activity_pub/publisher_test.exs
@@
-5,13
+5,14
@@
defmodule Pleroma.Web.ActivityPub.PublisherTest do
use Pleroma.Web.ConnCase
defmodule Pleroma.Web.ActivityPub.PublisherTest do
use Pleroma.Web.ConnCase
+ import ExUnit.CaptureLog
import Pleroma.Factory
import Tesla.Mock
import Mock
alias Pleroma.Activity
import Pleroma.Factory
import Tesla.Mock
import Mock
alias Pleroma.Activity
- alias Pleroma.Object
alias Pleroma.Instances
alias Pleroma.Instances
+ alias Pleroma.Object
alias Pleroma.Web.ActivityPub.Publisher
alias Pleroma.Web.CommonAPI
alias Pleroma.Web.ActivityPub.Publisher
alias Pleroma.Web.CommonAPI
@@
-190,7
+191,10
@@
defmodule Pleroma.Web.ActivityPub.PublisherTest do
actor = insert(:user)
inbox = "http://connrefused.site/users/nick1/inbox"
actor = insert(:user)
inbox = "http://connrefused.site/users/nick1/inbox"
- assert {:error, _} = Publisher.publish_one(%{inbox: inbox, json: "{}", actor: actor, id: 1})
+ assert capture_log(fn ->
+ assert {:error, _} =
+ Publisher.publish_one(%{inbox: inbox, json: "{}", actor: actor, id: 1})
+ end) =~ "connrefused"
assert called(Instances.set_unreachable(inbox))
end
assert called(Instances.set_unreachable(inbox))
end
@@
-214,14
+218,16
@@
defmodule Pleroma.Web.ActivityPub.PublisherTest do
actor = insert(:user)
inbox = "http://connrefused.site/users/nick1/inbox"
actor = insert(:user)
inbox = "http://connrefused.site/users/nick1/inbox"
- assert {:error, _} =
- Publisher.publish_one(%{
- inbox: inbox,
- json: "{}",
- actor: actor,
- id: 1,
- unreachable_since: NaiveDateTime.utc_now()
- })
+ assert capture_log(fn ->
+ assert {:error, _} =
+ Publisher.publish_one(%{
+ inbox: inbox,
+ json: "{}",
+ actor: actor,
+ id: 1,
+ unreachable_since: NaiveDateTime.utc_now()
+ })
+ end) =~ "connrefused"
refute called(Instances.set_unreachable(inbox))
end
refute called(Instances.set_unreachable(inbox))
end
@@
-259,7
+265,7
@@
defmodule Pleroma.Web.ActivityPub.PublisherTest do
assert called(
Pleroma.Web.Federator.Publisher.enqueue_one(Publisher, %{
inbox: "https://domain.com/users/nick1/inbox",
assert called(
Pleroma.Web.Federator.Publisher.enqueue_one(Publisher, %{
inbox: "https://domain.com/users/nick1/inbox",
- actor
: actor
,
+ actor
_id: actor.id
,
id: note_activity.data["id"]
})
)
id: note_activity.data["id"]
})
)
@@
-315,7
+321,7
@@
defmodule Pleroma.Web.ActivityPub.PublisherTest do
assert called(
Pleroma.Web.Federator.Publisher.enqueue_one(Publisher, %{
inbox: "https://domain.com/users/nick1/inbox",
assert called(
Pleroma.Web.Federator.Publisher.enqueue_one(Publisher, %{
inbox: "https://domain.com/users/nick1/inbox",
- actor
: actor
,
+ actor
_id: actor.id
,
id: delete.data["id"]
})
)
id: delete.data["id"]
})
)
@@
-323,7
+329,7
@@
defmodule Pleroma.Web.ActivityPub.PublisherTest do
assert called(
Pleroma.Web.Federator.Publisher.enqueue_one(Publisher, %{
inbox: "https://domain2.com/users/nick1/inbox",
assert called(
Pleroma.Web.Federator.Publisher.enqueue_one(Publisher, %{
inbox: "https://domain2.com/users/nick1/inbox",
- actor
: actor
,
+ actor
_id: actor.id
,
id: delete.data["id"]
})
)
id: delete.data["id"]
})
)