diff options
| author | lain <lain@soykaf.club> | 2020-08-17 12:26:53 +0000 |
|---|---|---|
| committer | lain <lain@soykaf.club> | 2020-08-17 12:26:53 +0000 |
| commit | e154fcf5258879c68fd7bd9fddd56d3dcb787826 (patch) | |
| tree | 49baeee246b7493acbbeb9dc112488cbac4b69ea /test/web/preload | |
| parent | 1f2aad6fda22a3af8b475b5e4a01eae95a3438da (diff) | |
| parent | 60ac83a4c196233ed13c3da9ca296b0a4224e9a3 (diff) | |
| download | pleroma-e154fcf5258879c68fd7bd9fddd56d3dcb787826.tar.gz pleroma-e154fcf5258879c68fd7bd9fddd56d3dcb787826.zip | |
Merge branch '2046-default-restrict-unauthenticated-basing-on-instance-privacy' into 'develop'
[#2046] Defaulted pleroma/restrict_unauthenticated basing on instance privacy
Closes #2046
See merge request pleroma/pleroma!2890
Diffstat (limited to 'test/web/preload')
| -rw-r--r-- | test/web/preload/timeline_test.exs | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/test/web/preload/timeline_test.exs b/test/web/preload/timeline_test.exs index fea95a6a4..3b1f2f1aa 100644 --- a/test/web/preload/timeline_test.exs +++ b/test/web/preload/timeline_test.exs @@ -12,16 +12,8 @@ defmodule Pleroma.Web.Preload.Providers.TimelineTest do @public_url "/api/v1/timelines/public" describe "unauthenticated timeliness when restricted" do - setup do - svd_config = Pleroma.Config.get([:restrict_unauthenticated, :timelines]) - Pleroma.Config.put([:restrict_unauthenticated, :timelines], %{local: true, federated: true}) - - on_exit(fn -> - Pleroma.Config.put([:restrict_unauthenticated, :timelines], svd_config) - end) - - :ok - end + setup do: clear_config([:restrict_unauthenticated, :timelines, :local], true) + setup do: clear_config([:restrict_unauthenticated, :timelines, :federated], true) test "return nothing" do tl_data = Timelines.generate_terms(%{}) @@ -31,20 +23,10 @@ defmodule Pleroma.Web.Preload.Providers.TimelineTest do end describe "unauthenticated timeliness when unrestricted" do - setup do - svd_config = Pleroma.Config.get([:restrict_unauthenticated, :timelines]) + setup do: clear_config([:restrict_unauthenticated, :timelines, :local], false) + setup do: clear_config([:restrict_unauthenticated, :timelines, :federated], false) - Pleroma.Config.put([:restrict_unauthenticated, :timelines], %{ - local: false, - federated: false - }) - - on_exit(fn -> - Pleroma.Config.put([:restrict_unauthenticated, :timelines], svd_config) - end) - - {:ok, user: insert(:user)} - end + setup do: {:ok, user: insert(:user)} test "returns the timeline when not restricted" do assert Timelines.generate_terms(%{}) |
