Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

30 行
701B

  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Plugs.EnsureUserKeyPlugTest do
  5. use Pleroma.Web.ConnCase, async: true
  6. alias Pleroma.Plugs.EnsureUserKeyPlug
  7. test "if the conn has a user key set, it does nothing", %{conn: conn} do
  8. conn =
  9. conn
  10. |> assign(:user, 1)
  11. ret_conn =
  12. conn
  13. |> EnsureUserKeyPlug.call(%{})
  14. assert conn == ret_conn
  15. end
  16. test "if the conn has no key set, it sets it to nil", %{conn: conn} do
  17. conn =
  18. conn
  19. |> EnsureUserKeyPlug.call(%{})
  20. assert Map.has_key?(conn.assigns, :user)
  21. end
  22. end