1 defmodule Pleroma.Plugs.EnsureUserKeyPlugTest do
2 use Pleroma.Web.ConnCase, async: true
4 alias Pleroma.Plugs.EnsureUserKeyPlug
6 test "if the conn has a user key set, it does nothing", %{conn: conn} do
13 |> EnsureUserKeyPlug.call(%{})
15 assert conn == ret_conn
18 test "if the conn has no key set, it sets it to nil", %{conn: conn} do
21 |> EnsureUserKeyPlug.call(%{})
23 assert Map.has_key?(conn.assigns, :user)