Fix RichMedia.HelpersTest

This commit is contained in:
Alex Gleason 2021-05-04 17:18:20 -05:00
parent 359c1d9f1f
commit e1996d7b96
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -30,7 +30,7 @@ test "refuses to crawl incomplete URLs" do
clear_config([:rich_media, :enabled], true)
assert %{} == Pleroma.Web.RichMedia.Helpers.fetch_data_for_activity(activity)
assert Pleroma.Web.RichMedia.Helpers.fetch_data_for_activity(activity) == nil
end
test "refuses to crawl malformed URLs" do
@ -44,7 +44,7 @@ test "refuses to crawl malformed URLs" do
clear_config([:rich_media, :enabled], true)
assert %{} == Pleroma.Web.RichMedia.Helpers.fetch_data_for_activity(activity)
assert Pleroma.Web.RichMedia.Helpers.fetch_data_for_activity(activity) == nil
end
test "crawls valid, complete URLs" do
@ -58,7 +58,7 @@ test "crawls valid, complete URLs" do
clear_config([:rich_media, :enabled], true)
assert %{page_url: "https://example.com/ogp", rich_media: _} =
assert %{url: "https://example.com/ogp", meta: %{} = _} =
Pleroma.Web.RichMedia.Helpers.fetch_data_for_activity(activity)
end
@ -75,10 +75,10 @@ test "refuses to crawl URLs of private network from posts" do
clear_config([:rich_media, :enabled], true)
assert %{} = Helpers.fetch_data_for_activity(activity)
assert %{} = Helpers.fetch_data_for_activity(activity2)
assert %{} = Helpers.fetch_data_for_activity(activity3)
assert %{} = Helpers.fetch_data_for_activity(activity4)
assert %{} = Helpers.fetch_data_for_activity(activity5)
assert Helpers.fetch_data_for_activity(activity) == nil
assert Helpers.fetch_data_for_activity(activity2) == nil
assert Helpers.fetch_data_for_activity(activity3) == nil
assert Helpers.fetch_data_for_activity(activity4) == nil
assert Helpers.fetch_data_for_activity(activity5) == nil
end
end