Assign token that can write to follows
authorMark Felder <feld@FreeBSD.org>
Sun, 12 Jan 2020 18:14:09 +0000 (12:14 -0600)
committerMark Felder <feld@FreeBSD.org>
Sun, 12 Jan 2020 18:14:09 +0000 (12:14 -0600)
test/web/twitter_api/remote_follow_controller_test.exs

index dd2f00dfe938a501a6ef581c5872780be611e3e7..4449493759540276d074c1b413ac1c0dc5e1465c 100644 (file)
@@ -95,6 +95,7 @@ defmodule Pleroma.Web.TwitterAPI.RemoteFollowControllerTest do
       response =
         conn
         |> assign(:user, user)
+        |> assign(:token, insert(:oauth_token, user: user, scopes: ["write:follows"]))
         |> post(remote_follow_path(conn, :do_follow), %{"user" => %{"id" => user2.id}})
         |> response(200)
 
@@ -151,6 +152,7 @@ defmodule Pleroma.Web.TwitterAPI.RemoteFollowControllerTest do
       response =
         conn
         |> assign(:user, refresh_record(user))
+        |> assign(:token, insert(:oauth_token, user: user, scopes: ["write:follows"]))
         |> post(remote_follow_path(conn, :do_follow), %{"user" => %{"id" => user2.id}})
         |> response(200)