diff options
author | lain <lain@soykaf.club> | 2020-04-17 15:51:24 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-04-17 15:51:24 +0200 |
commit | 8c2c325598dcd85f76752a17b39ce27689a65250 (patch) | |
tree | 5283acd447e60c401631aab4b01768d3f79d142e /test/plugs/oauth_scopes_plug_test.exs | |
parent | 372614cfd3119b589c9c47619445714e8ae6c07e (diff) | |
parent | 6936854878860d1f6d04db1cd14a00208c6a5728 (diff) | |
download | pleroma-8c2c325598dcd85f76752a17b39ce27689a65250.tar.gz pleroma-8c2c325598dcd85f76752a17b39ce27689a65250.zip |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
Diffstat (limited to 'test/plugs/oauth_scopes_plug_test.exs')
-rw-r--r-- | test/plugs/oauth_scopes_plug_test.exs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/plugs/oauth_scopes_plug_test.exs b/test/plugs/oauth_scopes_plug_test.exs index e79ecf263..abab7abb0 100644 --- a/test/plugs/oauth_scopes_plug_test.exs +++ b/test/plugs/oauth_scopes_plug_test.exs @@ -7,6 +7,7 @@ defmodule Pleroma.Plugs.OAuthScopesPlugTest do alias Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug alias Pleroma.Plugs.OAuthScopesPlug + alias Pleroma.Plugs.PlugHelper alias Pleroma.Repo import Mock @@ -16,6 +17,18 @@ defmodule Pleroma.Plugs.OAuthScopesPlugTest do :ok end + test "is not performed if marked as skipped", %{conn: conn} do + with_mock OAuthScopesPlug, [:passthrough], perform: &passthrough([&1, &2]) do + conn = + conn + |> PlugHelper.append_to_skipped_plugs(OAuthScopesPlug) + |> OAuthScopesPlug.call(%{scopes: ["random_scope"]}) + + refute called(OAuthScopesPlug.perform(:_, :_)) + refute conn.halted + end + end + test "if `token.scopes` fulfills specified 'any of' conditions, " <> "proceeds with no op", %{conn: conn} do |