summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/timeline_controller_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-03-20 16:54:55 +0000
committerlain <lain@soykaf.club>2020-03-20 16:54:55 +0000
commitd23e81903dfe5032bb20b92bcc7dfb47434ba669 (patch)
treedb7724289ac074e0b70b7405d9080e50b8a8175d /test/web/mastodon_api/controllers/timeline_controller_test.exs
parent5efa5b0c4a08c2bf73d6926ee7c418e31a04195c (diff)
parent1c05f539aaea32fe993e5299e656aa44c322e8de (diff)
downloadpleroma-d23e81903dfe5032bb20b92bcc7dfb47434ba669.tar.gz
pleroma-d23e81903dfe5032bb20b92bcc7dfb47434ba669.zip
Merge branch 'clear-config-test-improvements' into 'develop'
Improved in-test config management See merge request pleroma/pleroma!2312
Diffstat (limited to 'test/web/mastodon_api/controllers/timeline_controller_test.exs')
-rw-r--r--test/web/mastodon_api/controllers/timeline_controller_test.exs16
1 files changed, 4 insertions, 12 deletions
diff --git a/test/web/mastodon_api/controllers/timeline_controller_test.exs b/test/web/mastodon_api/controllers/timeline_controller_test.exs
index a15c759d4..6fedb4223 100644
--- a/test/web/mastodon_api/controllers/timeline_controller_test.exs
+++ b/test/web/mastodon_api/controllers/timeline_controller_test.exs
@@ -100,13 +100,9 @@ defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do
describe "public with restrict unauthenticated timeline for local and federated timelines" do
setup do: local_and_remote_activities()
- clear_config([:restrict_unauthenticated, :timelines, :local]) do
- Config.put([:restrict_unauthenticated, :timelines, :local], true)
- end
+ setup do: clear_config([:restrict_unauthenticated, :timelines, :local], true)
- clear_config([:restrict_unauthenticated, :timelines, :federated]) do
- Config.put([:restrict_unauthenticated, :timelines, :federated], true)
- end
+ setup do: clear_config([:restrict_unauthenticated, :timelines, :federated], true)
test "if user is unauthenticated", %{conn: conn} do
res_conn = get(conn, "/api/v1/timelines/public", %{"local" => "true"})
@@ -136,9 +132,7 @@ defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do
describe "public with restrict unauthenticated timeline for local" do
setup do: local_and_remote_activities()
- clear_config([:restrict_unauthenticated, :timelines, :local]) do
- Config.put([:restrict_unauthenticated, :timelines, :local], true)
- end
+ setup do: clear_config([:restrict_unauthenticated, :timelines, :local], true)
test "if user is unauthenticated", %{conn: conn} do
res_conn = get(conn, "/api/v1/timelines/public", %{"local" => "true"})
@@ -165,9 +159,7 @@ defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do
describe "public with restrict unauthenticated timeline for remote" do
setup do: local_and_remote_activities()
- clear_config([:restrict_unauthenticated, :timelines, :federated]) do
- Config.put([:restrict_unauthenticated, :timelines, :federated], true)
- end
+ setup do: clear_config([:restrict_unauthenticated, :timelines, :federated], true)
test "if user is unauthenticated", %{conn: conn} do
res_conn = get(conn, "/api/v1/timelines/public", %{"local" => "true"})