Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags...
[akkoma] / test / pleroma / web / feed / tag_controller_test.exs
index e4084b0e554424b94956c80ff0cbd7c0abaa1cd1..5c9201de1e3de82c15cce7666fa258215f8e471f 100644 (file)
@@ -1,5 +1,5 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.Feed.TagControllerTest do
@@ -8,7 +8,6 @@ defmodule Pleroma.Web.Feed.TagControllerTest do
   import Pleroma.Factory
   import SweetXml
 
-  alias Pleroma.Config
   alias Pleroma.Object
   alias Pleroma.Web.CommonAPI
   alias Pleroma.Web.Feed.FeedView
@@ -16,7 +15,7 @@ defmodule Pleroma.Web.Feed.TagControllerTest do
   setup do: clear_config([:feed])
 
   test "gets a feed (ATOM)", %{conn: conn} do
-    Config.put(
+    clear_config(
       [:feed, :post_title],
       %{max_length: 25, omission: "..."}
     )
@@ -24,7 +23,7 @@ defmodule Pleroma.Web.Feed.TagControllerTest do
     user = insert(:user)
     {:ok, activity1} = CommonAPI.post(user, %{status: "yeah #PleromaArt"})
 
-    object = Object.normalize(activity1)
+    object = Object.normalize(activity1, fetch: false)
 
     object_data =
       Map.put(object.data, "attachment", [
@@ -83,7 +82,7 @@ defmodule Pleroma.Web.Feed.TagControllerTest do
   end
 
   test "gets a feed (RSS)", %{conn: conn} do
-    Config.put(
+    clear_config(
       [:feed, :post_title],
       %{max_length: 25, omission: "..."}
     )
@@ -91,7 +90,7 @@ defmodule Pleroma.Web.Feed.TagControllerTest do
     user = insert(:user)
     {:ok, activity1} = CommonAPI.post(user, %{status: "yeah #PleromaArt"})
 
-    object = Object.normalize(activity1)
+    object = Object.normalize(activity1, fetch: false)
 
     object_data =
       Map.put(object.data, "attachment", [
@@ -131,7 +130,7 @@ defmodule Pleroma.Web.Feed.TagControllerTest do
              '#{Pleroma.Web.base_url()}/tags/pleromaart.rss'
 
     assert xpath(xml, ~x"//channel/webfeeds:logo/text()") ==
-             '#{Pleroma.Web.base_url()}/static/logo.png'
+             '#{Pleroma.Web.base_url()}/static/logo.svg'
 
     assert xpath(xml, ~x"//channel/item/title/text()"l) == [
              '42 This is :moominmamm...',
@@ -147,8 +146,8 @@ defmodule Pleroma.Web.Feed.TagControllerTest do
              "https://peertube.moe/static/webseed/df5f464b-be8d-46fb-ad81-2d4c2d1630e3-480.mp4"
            ]
 
-    obj1 = Object.normalize(activity1)
-    obj2 = Object.normalize(activity2)
+    obj1 = Object.normalize(activity1, fetch: false)
+    obj2 = Object.normalize(activity2, fetch: false)
 
     assert xpath(xml, ~x"//channel/item/description/text()"sl) == [
              HtmlEntities.decode(FeedView.activity_content(obj2.data)),