Improved in-test config management functions.

This commit is contained in:
Ivan Tashkinov 2020-03-18 20:30:31 +03:00
commit ec3719f539
32 changed files with 89 additions and 155 deletions

View file

@ -12,13 +12,9 @@ defmodule Pleroma.Web.OAuth.LDAPAuthorizationTest do
@skip if !Code.ensure_loaded?(:eldap), do: :skip
clear_config_all([:ldap, :enabled]) do
Pleroma.Config.put([:ldap, :enabled], true)
end
clear_config_all([:ldap, :enabled], true)
clear_config_all(Pleroma.Web.Auth.Authenticator) do
Pleroma.Config.put(Pleroma.Web.Auth.Authenticator, Pleroma.Web.Auth.LDAPAuthenticator)
end
clear_config_all(Pleroma.Web.Auth.Authenticator, Pleroma.Web.Auth.LDAPAuthenticator)
@tag @skip
test "authorizes the existing user using LDAP credentials" do

View file

@ -31,12 +31,7 @@ defmodule Pleroma.Web.OAuth.OAuthControllerTest do
]
end
clear_config([:auth, :oauth_consumer_strategies]) do
Pleroma.Config.put(
[:auth, :oauth_consumer_strategies],
~w(twitter facebook)
)
end
clear_config([:auth, :oauth_consumer_strategies], ~w(twitter facebook))
test "GET /oauth/authorize renders auth forms, including OAuth consumer form", %{
app: app,