diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-12-19 17:23:27 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-12-19 17:23:27 +0300 |
commit | 455e072d27f28c39050b2dc24b346a8f2ef30f90 (patch) | |
tree | 37906a1131bf70777316e24af19382f053f8c0c1 /test/web/masto_fe_controller_test.exs | |
parent | 7973cbdb9fa9120306cb5a265a477eeccd315ee6 (diff) | |
download | pleroma-455e072d27f28c39050b2dc24b346a8f2ef30f90.tar.gz pleroma-455e072d27f28c39050b2dc24b346a8f2ef30f90.zip |
[#2068] Introduced proper OAuth tokens usage to controller tests.
Diffstat (limited to 'test/web/masto_fe_controller_test.exs')
-rw-r--r-- | test/web/masto_fe_controller_test.exs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/web/masto_fe_controller_test.exs b/test/web/masto_fe_controller_test.exs index b5dbd4a25..f9870a852 100644 --- a/test/web/masto_fe_controller_test.exs +++ b/test/web/masto_fe_controller_test.exs @@ -18,6 +18,7 @@ defmodule Pleroma.Web.MastodonAPI.MastoFEController do conn = conn |> assign(:user, user) + |> assign(:token, insert(:oauth_token, user: user, scopes: ["write:accounts"])) |> put("/api/web/settings", %{"data" => %{"programming" => "socks"}}) assert _result = json_response(conn, 200) @@ -63,12 +64,12 @@ defmodule Pleroma.Web.MastodonAPI.MastoFEController do end test "does not redirect logged in users to the login page", %{conn: conn, path: path} do - token = insert(:oauth_token) + token = insert(:oauth_token, scopes: ["read"]) conn = conn |> assign(:user, token.user) - |> put_session(:oauth_token, token.token) + |> assign(:token, token) |> get(path) assert conn.status == 200 |