diff options
| author | lain <lain@soykaf.club> | 2020-04-06 17:50:31 +0200 | 
|---|---|---|
| committer | lain <lain@soykaf.club> | 2020-04-06 17:50:31 +0200 | 
| commit | 19335be24c25739e2334180af6c59dd8919d5fc8 (patch) | |
| tree | db34531b2dd5befb495d4379aa8aaad9284fa72c /test/web/oauth | |
| parent | fd97b0e634d30dec3217efcf3d67610d1b54bf8b (diff) | |
| parent | 1d4ab06505ec5143dbb1d78d718fa9efd1497751 (diff) | |
| download | pleroma-19335be24c25739e2334180af6c59dd8919d5fc8.tar.gz pleroma-19335be24c25739e2334180af6c59dd8919d5fc8.zip | |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
Diffstat (limited to 'test/web/oauth')
| -rw-r--r-- | test/web/oauth/ldap_authorization_test.exs | 8 | ||||
| -rw-r--r-- | test/web/oauth/oauth_controller_test.exs | 14 | 
2 files changed, 6 insertions, 16 deletions
| diff --git a/test/web/oauth/ldap_authorization_test.exs b/test/web/oauth/ldap_authorization_test.exs index c55b0ffc5..a8fe8a841 100644 --- a/test/web/oauth/ldap_authorization_test.exs +++ b/test/web/oauth/ldap_authorization_test.exs @@ -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 +  setup_all do: clear_config([:ldap, :enabled], true) -  clear_config_all(Pleroma.Web.Auth.Authenticator) do -    Pleroma.Config.put(Pleroma.Web.Auth.Authenticator, Pleroma.Web.Auth.LDAPAuthenticator) -  end +  setup_all do: clear_config(Pleroma.Web.Auth.Authenticator, Pleroma.Web.Auth.LDAPAuthenticator)    @tag @skip    test "authorizes the existing user using LDAP credentials" do diff --git a/test/web/oauth/oauth_controller_test.exs b/test/web/oauth/oauth_controller_test.exs index cff469c28..f2f98d768 100644 --- a/test/web/oauth/oauth_controller_test.exs +++ b/test/web/oauth/oauth_controller_test.exs @@ -17,8 +17,7 @@ defmodule Pleroma.Web.OAuth.OAuthControllerTest do      key: "_test",      signing_salt: "cooldude"    ] - -  clear_config([:instance, :account_activation_required]) +  setup do: clear_config([:instance, :account_activation_required])    describe "in OAuth consumer mode, " do      setup do @@ -31,12 +30,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 +    setup do: clear_config([:auth, :oauth_consumer_strategies], ~w(twitter facebook))      test "GET /oauth/authorize renders auth forms, including OAuth consumer form", %{        app: app, @@ -581,7 +575,7 @@ defmodule Pleroma.Web.OAuth.OAuthControllerTest do        # In case scope param is missing, expecting _all_ app-supported scopes to be granted        for user <- [non_admin, admin],            {requested_scopes, expected_scopes} <- -            %{scopes_subset => scopes_subset, nil => app_scopes} do +            %{scopes_subset => scopes_subset, nil: app_scopes} do          conn =            post(              build_conn(), @@ -944,7 +938,7 @@ defmodule Pleroma.Web.OAuth.OAuthControllerTest do    end    describe "POST /oauth/token - refresh token" do -    clear_config([:oauth2, :issue_new_refresh_token]) +    setup do: clear_config([:oauth2, :issue_new_refresh_token])      test "issues a new access token with keep fresh token" do        Pleroma.Config.put([:oauth2, :issue_new_refresh_token], true) | 
