diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-08-18 18:02:09 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-08-18 18:02:09 +0300 |
commit | 27e7999a151d8068ec503c9a25aff352f4d31068 (patch) | |
tree | c6de5995748aee92878514c7a6e24c58f4641c2b /test/web/preload | |
parent | f50c653c8d63ce8fcffe62d70c61ab464e8e6c8e (diff) | |
parent | 8d70692abf64244e44ade5ef2055d1a586788dd1 (diff) | |
download | pleroma-27e7999a151d8068ec503c9a25aff352f4d31068.tar.gz pleroma-27e7999a151d8068ec503c9a25aff352f4d31068.zip |
Merge remote-tracking branch 'remotes/origin/develop' into 2168-media-preview-proxy
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(%{}) |