X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fobject%2Ffetcher_test.exs;h=2aad7a5883b3811726d05e5f666c547019030171;hb=646016c403f6ed10f00f9c67b477a231f71aa706;hp=895a73d2c893b7ad201fbe6bef1c26dd085ab6ee;hpb=cc28184854970c6f8406fc588686e9b275f06ee4;p=akkoma diff --git a/test/object/fetcher_test.exs b/test/object/fetcher_test.exs index 895a73d2c..2aad7a588 100644 --- a/test/object/fetcher_test.exs +++ b/test/object/fetcher_test.exs @@ -27,31 +27,16 @@ defmodule Pleroma.Object.FetcherTest do end describe "actor origin containment" do - test_with_mock "it rejects objects with a bogus origin", - Pleroma.Web.OStatus, - [:passthrough], - [] do + test "it rejects objects with a bogus origin" do {:error, _} = Fetcher.fetch_object_from_id("https://info.pleroma.site/activity.json") - - refute called(Pleroma.Web.OStatus.fetch_activity_from_url(:_)) end - test_with_mock "it rejects objects when attributedTo is wrong (variant 1)", - Pleroma.Web.OStatus, - [:passthrough], - [] do + test "it rejects objects when attributedTo is wrong (variant 1)" do {:error, _} = Fetcher.fetch_object_from_id("https://info.pleroma.site/activity2.json") - - refute called(Pleroma.Web.OStatus.fetch_activity_from_url(:_)) end - test_with_mock "it rejects objects when attributedTo is wrong (variant 2)", - Pleroma.Web.OStatus, - [:passthrough], - [] do + test "it rejects objects when attributedTo is wrong (variant 2)" do {:error, _} = Fetcher.fetch_object_from_id("https://info.pleroma.site/activity3.json") - - refute called(Pleroma.Web.OStatus.fetch_activity_from_url(:_)) end end @@ -71,24 +56,6 @@ defmodule Pleroma.Object.FetcherTest do assert object == object_again end - - test "it works with objects only available via Ostatus" do - {:ok, object} = Fetcher.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} = Fetcher.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} = Fetcher.fetch_object_from_id(last) - - object = Object.get_by_ap_id(object.data["inReplyTo"]) - assert object - end end describe "implementation quirks" do @@ -110,6 +77,15 @@ defmodule Pleroma.Object.FetcherTest do assert object end + test "it can fetch Mobilizon events" do + {:ok, object} = + Fetcher.fetch_object_from_id( + "https://mobilizon.org/events/252d5816-00a3-4a89-a66f-15bf65c33e39" + ) + + assert object + end + test "it can fetch wedistribute articles" do {:ok, object} = Fetcher.fetch_object_from_id("https://wedistribute.org/wp-json/pterotype/v1/object/85810")