Convert tests to all use clear_config instead of Pleroma.Config.put

This commit is contained in:
Mark Felder 2021-01-26 11:58:43 -06:00
commit e854c35e65
69 changed files with 325 additions and 368 deletions

View file

@ -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: "..."}
)
@ -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: "..."}
)

View file

@ -8,7 +8,6 @@ defmodule Pleroma.Web.Feed.UserControllerTest do
import Pleroma.Factory
import SweetXml
alias Pleroma.Config
alias Pleroma.Object
alias Pleroma.User
alias Pleroma.Web.CommonAPI
@ -20,7 +19,7 @@ defmodule Pleroma.Web.Feed.UserControllerTest do
setup do: clear_config([:feed])
setup do
Config.put(
clear_config(
[:feed, :post_title],
%{max_length: 15, omission: "..."}
)
@ -236,7 +235,7 @@ defmodule Pleroma.Web.Feed.UserControllerTest do
setup do: clear_config([:instance, :public])
test "returns 404 for user feed", %{conn: conn} do
Config.put([:instance, :public], false)
clear_config([:instance, :public], false)
user = insert(:user)
{:ok, _} = CommonAPI.post(user, %{status: "test"})