Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

26 wiersze
542B

  1. defmodule Pleroma.Plugs.EnsureUserKeyPlugTest do
  2. use Pleroma.Web.ConnCase, async: true
  3. alias Pleroma.Plugs.EnsureUserKeyPlug
  4. test "if the conn has a user key set, it does nothing", %{conn: conn} do
  5. conn =
  6. conn
  7. |> assign(:user, 1)
  8. ret_conn =
  9. conn
  10. |> EnsureUserKeyPlug.call(%{})
  11. assert conn == ret_conn
  12. end
  13. test "if the conn has no key set, it sets it to nil", %{conn: conn} do
  14. conn =
  15. conn
  16. |> EnsureUserKeyPlug.call(%{})
  17. assert Map.has_key?(conn.assigns, :user)
  18. end
  19. end