projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
DeleteValidator: Add internal helper field after validation.
[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 c8eed68b608b2ab4c87d2c0f1ace9913d2aebd6e..c2bc38d52508fdf896d2781484dfe742080d4919 100644
(file)
--- a/
test/web/activity_pub/publisher_test.exs
+++ b/
test/web/activity_pub/publisher_test.exs
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 201
9
Pleroma Authors <https://pleroma.social/>
+# Copyright © 201
7-2020
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.PublisherTest do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.PublisherTest do
@@
-23,9
+23,7
@@
defmodule Pleroma.Web.ActivityPub.PublisherTest do
:ok
end
:ok
end
- clear_config_all([:instance, :federating]) do
- Pleroma.Config.put([:instance, :federating], true)
- end
+ setup_all do: clear_config([:instance, :federating], true)
describe "gather_webfinger_links/1" do
test "it returns links" do
describe "gather_webfinger_links/1" do
test "it returns links" do
@@
-50,10
+48,7
@@
defmodule Pleroma.Web.ActivityPub.PublisherTest do
describe "determine_inbox/2" do
test "it returns sharedInbox for messages involving as:Public in to" do
describe "determine_inbox/2" do
test "it returns sharedInbox for messages involving as:Public in to" do
- user =
- insert(:user, %{
- source_data: %{"endpoints" => %{"sharedInbox" => "http://example.com/inbox"}}
- })
+ user = insert(:user, %{shared_inbox: "http://example.com/inbox"})
activity = %Activity{
data: %{"to" => [@as_public], "cc" => [user.follower_address]}
activity = %Activity{
data: %{"to" => [@as_public], "cc" => [user.follower_address]}
@@
-63,10
+58,7
@@
defmodule Pleroma.Web.ActivityPub.PublisherTest do
end
test "it returns sharedInbox for messages involving as:Public in cc" do
end
test "it returns sharedInbox for messages involving as:Public in cc" do
- user =
- insert(:user, %{
- source_data: %{"endpoints" => %{"sharedInbox" => "http://example.com/inbox"}}
- })
+ user = insert(:user, %{shared_inbox: "http://example.com/inbox"})
activity = %Activity{
data: %{"cc" => [@as_public], "to" => [user.follower_address]}
activity = %Activity{
data: %{"cc" => [@as_public], "to" => [user.follower_address]}
@@
-76,11
+68,7
@@
defmodule Pleroma.Web.ActivityPub.PublisherTest do
end
test "it returns sharedInbox for messages involving multiple recipients in to" do
end
test "it returns sharedInbox for messages involving multiple recipients in to" do
- user =
- insert(:user, %{
- source_data: %{"endpoints" => %{"sharedInbox" => "http://example.com/inbox"}}
- })
-
+ user = insert(:user, %{shared_inbox: "http://example.com/inbox"})
user_two = insert(:user)
user_three = insert(:user)
user_two = insert(:user)
user_three = insert(:user)
@@
-92,11
+80,7
@@
defmodule Pleroma.Web.ActivityPub.PublisherTest do
end
test "it returns sharedInbox for messages involving multiple recipients in cc" do
end
test "it returns sharedInbox for messages involving multiple recipients in cc" do
- user =
- insert(:user, %{
- source_data: %{"endpoints" => %{"sharedInbox" => "http://example.com/inbox"}}
- })
-
+ user = insert(:user, %{shared_inbox: "http://example.com/inbox"})
user_two = insert(:user)
user_three = insert(:user)
user_two = insert(:user)
user_three = insert(:user)
@@
-109,12
+93,10
@@
defmodule Pleroma.Web.ActivityPub.PublisherTest do
test "it returns sharedInbox for messages involving multiple recipients in total" do
user =
test "it returns sharedInbox for messages involving multiple recipients in total" do
user =
- insert(:user,
- source_data: %{
- "inbox" => "http://example.com/personal-inbox",
- "endpoints" => %{"sharedInbox" => "http://example.com/inbox"}
- }
- )
+ insert(:user, %{
+ shared_inbox: "http://example.com/inbox",
+ inbox: "http://example.com/personal-inbox"
+ })
user_two = insert(:user)
user_two = insert(:user)
@@
-127,12
+109,10
@@
defmodule Pleroma.Web.ActivityPub.PublisherTest do
test "it returns inbox for messages involving single recipients in total" do
user =
test "it returns inbox for messages involving single recipients in total" do
user =
- insert(:user,
- source_data: %{
- "inbox" => "http://example.com/personal-inbox",
- "endpoints" => %{"sharedInbox" => "http://example.com/inbox"}
- }
- )
+ insert(:user, %{
+ shared_inbox: "http://example.com/inbox",
+ inbox: "http://example.com/personal-inbox"
+ })
activity = %Activity{
data: %{"to" => [user.ap_id], "cc" => []}
activity = %Activity{
data: %{"to" => [user.ap_id], "cc" => []}
@@
-260,11
+240,11
@@
defmodule Pleroma.Web.ActivityPub.PublisherTest do
[:passthrough],
[] do
follower =
[:passthrough],
[] do
follower =
- insert(:user,
+ insert(:user,
%{
local: false,
local: false,
-
source_data: %{"inbox" => "https://domain.com/users/nick1/inbox"}
,
+
inbox: "https://domain.com/users/nick1/inbox"
,
ap_enabled: true
ap_enabled: true
- )
+
}
)
actor = insert(:user, follower_address: follower.ap_id)
user = insert(:user)
actor = insert(:user, follower_address: follower.ap_id)
user = insert(:user)
@@
-297,14
+277,14
@@
defmodule Pleroma.Web.ActivityPub.PublisherTest do
fetcher =
insert(:user,
local: false,
fetcher =
insert(:user,
local: false,
-
source_data: %{"inbox" => "https://domain.com/users/nick1/inbox"}
,
+
inbox: "https://domain.com/users/nick1/inbox"
,
ap_enabled: true
)
another_fetcher =
insert(:user,
local: false,
ap_enabled: true
)
another_fetcher =
insert(:user,
local: false,
-
source_data: %{"inbox" => "https://domain2.com/users/nick1/inbox"}
,
+
inbox: "https://domain2.com/users/nick1/inbox"
,
ap_enabled: true
)
ap_enabled: true
)