Revert "oauth2 fixes (#177)"
[akkoma] / test / pleroma / web / plugs / set_user_session_id_plug_test.exs
index a50e8010736596c2ece1cfa31a6148d247cca934..9814c80d8bb4f5873f8314cbcf51ab09fc0b6452 100644 (file)
@@ -1,10 +1,11 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Web.Plugs.SetUserSessionIdPlugTest do
   use Pleroma.Web.ConnCase, async: true
 
+  alias Pleroma.Helpers.AuthHelper
   alias Pleroma.Web.Plugs.SetUserSessionIdPlug
 
   setup %{conn: conn} do
@@ -28,7 +29,7 @@ defmodule Pleroma.Web.Plugs.SetUserSessionIdPlugTest do
     assert ret_conn == conn
   end
 
-  test "sets :oauth_token in session to :token assign", %{conn: conn} do
+  test "sets session token basing on :token assign", %{conn: conn} do
     %{user: user, token: oauth_token} = oauth_access(["read"])
 
     ret_conn =
@@ -37,6 +38,6 @@ defmodule Pleroma.Web.Plugs.SetUserSessionIdPlugTest do
       |> assign(:token, oauth_token)
       |> SetUserSessionIdPlug.call(%{})
 
-    assert get_session(ret_conn, :oauth_token) == oauth_token.token
+    assert AuthHelper.get_session_token(ret_conn) == oauth_token.token
   end
 end