1 defmodule Pleroma.Plugs.SetUserSessionIdPlugTest do
2 use Pleroma.Web.ConnCase, async: true
4 Code.ensure_compiled(Pleroma.User)
6 alias Pleroma.Plugs.SetUserSessionIdPlug
13 signing_salt: "cooldude"
18 |> Plug.Session.call(Plug.Session.init(session_opts))
24 test "doesn't do anything if the user isn't set", %{conn: conn} do
27 |> SetUserSessionIdPlug.call(%{})
29 assert ret_conn == conn
32 test "sets the user_id in the session to the user id of the user assign", %{conn: conn} do
35 |> assign(:user, %User{id: 1})
36 |> SetUserSessionIdPlug.call(%{})
38 id = get_session(conn, :user_id)