Improved in-test config management functions.
This commit is contained in:
parent
69341cbcba
commit
ec3719f539
32 changed files with 89 additions and 155 deletions
|
|
@ -12,9 +12,7 @@ defmodule Pleroma.Web.RuntimeStaticPlugTest do
|
|||
on_exit(fn -> File.rm_rf(@dir) end)
|
||||
end
|
||||
|
||||
clear_config([:instance, :static_dir]) do
|
||||
Pleroma.Config.put([:instance, :static_dir], @dir)
|
||||
end
|
||||
clear_config([:instance, :static_dir], @dir)
|
||||
|
||||
test "overrides index" do
|
||||
bundled_index = get(build_conn(), "/")
|
||||
|
|
|
|||
|
|
@ -9,9 +9,7 @@ defmodule Pleroma.Plugs.UserIsAdminPlugTest do
|
|||
import Pleroma.Factory
|
||||
|
||||
describe "unless [:auth, :enforce_oauth_admin_scope_usage]," do
|
||||
clear_config([:auth, :enforce_oauth_admin_scope_usage]) do
|
||||
Pleroma.Config.put([:auth, :enforce_oauth_admin_scope_usage], false)
|
||||
end
|
||||
clear_config([:auth, :enforce_oauth_admin_scope_usage], false)
|
||||
|
||||
test "accepts a user that is an admin" do
|
||||
user = insert(:user, is_admin: true)
|
||||
|
|
@ -42,9 +40,7 @@ defmodule Pleroma.Plugs.UserIsAdminPlugTest do
|
|||
end
|
||||
|
||||
describe "with [:auth, :enforce_oauth_admin_scope_usage]," do
|
||||
clear_config([:auth, :enforce_oauth_admin_scope_usage]) do
|
||||
Pleroma.Config.put([:auth, :enforce_oauth_admin_scope_usage], true)
|
||||
end
|
||||
clear_config([:auth, :enforce_oauth_admin_scope_usage], true)
|
||||
|
||||
setup do
|
||||
admin_user = insert(:user, is_admin: true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue