1 defmodule Pleroma.Plugs.SetUserSessionIdPlugTest do
2 use Pleroma.Web.ConnCase, async: true
4 alias Pleroma.Plugs.SetUserSessionIdPlug
11 signing_salt: "cooldude"
16 |> Plug.Session.call(Plug.Session.init(session_opts))
22 test "doesn't do anything if the user isn't set", %{conn: conn} do
25 |> SetUserSessionIdPlug.call(%{})
27 assert ret_conn == conn
30 test "sets the user_id in the session to the user id of the user assign", %{conn: conn} do
33 |> assign(:user, %User{id: 1})
34 |> SetUserSessionIdPlug.call(%{})
36 id = get_session(conn, :user_id)