[#1682] Fixed Basic Auth permissions issue by disabling OAuth scopes checks when...
[akkoma] / test / plugs / oauth_scopes_plug_test.exs
index 1b3aa85b6e3eee68c72d1823b80257cf66101db5..d855d4f5420f230c35c3536c8248b6e3d1f6c5b7 100644 (file)
@@ -16,6 +16,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
+        |> OAuthScopesPlug.skip_plug()
+        |> 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