end
end
- describe "fetching an object" do
- test "it fetches an object" do
- {:ok, object} =
- ActivityPub.fetch_object_from_id("http://mastodon.example.org/@admin/99541947525187367")
-
- assert activity = Activity.get_create_by_object_ap_id(object.data["id"])
- assert activity.data["id"]
-
- {:ok, object_again} =
- ActivityPub.fetch_object_from_id("http://mastodon.example.org/@admin/99541947525187367")
-
- assert [attachment] = object.data["attachment"]
- assert is_list(attachment["url"])
-
- assert object == object_again
- end
-
- test "it works with objects only available via Ostatus" do
- {:ok, object} = ActivityPub.fetch_object_from_id("https://shitposter.club/notice/2827873")
- assert activity = Activity.get_create_by_object_ap_id(object.data["id"])
- assert activity.data["id"]
-
- {:ok, object_again} =
- ActivityPub.fetch_object_from_id("https://shitposter.club/notice/2827873")
-
- assert object == object_again
- end
-
- test "it correctly stitches up conversations between ostatus and ap" do
- last = "https://mstdn.io/users/mayuutann/statuses/99568293732299394"
- {:ok, object} = ActivityPub.fetch_object_from_id(last)
-
- object = Object.get_by_ap_id(object.data["inReplyTo"])
- assert object
- end
- end
-
describe "following / unfollowing" do
test "creates a follow activity" do
follower = insert(:user)
end
end
- test "it can fetch peertube videos" do
- {:ok, object} =
- ActivityPub.fetch_object_from_id(
- "https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3"
- )
-
- assert object
- end
-
test "returned pinned statuses" do
Pleroma.Config.put([:instance, :max_pinned_statuses], 3)
user = insert(:user)
use Pleroma.DataCase
alias Pleroma.Activity
alias Pleroma.Object
+ alias Pleroma.Object.Fetcher
alias Pleroma.Repo
alias Pleroma.User
alias Pleroma.Web.ActivityPub.ActivityPub
test "it remaps video URLs as attachments if necessary" do
{:ok, object} =
- ActivityPub.fetch_object_from_id(
+ Fetcher.fetch_object_from_id(
"https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3"
)
test "all objects with fake directions are rejected by the object fetcher" do
{:error, _} =
- ActivityPub.fetch_and_contain_remote_object_from_id(
+ Fetcher.fetch_and_contain_remote_object_from_id(
"https://info.pleroma.site/activity4.json"
)
end