Fix user representation after following.
authorRoger Braun <roger@rogerbraun.net>
Wed, 12 Apr 2017 14:38:55 +0000 (16:38 +0200)
committerRoger Braun <roger@rogerbraun.net>
Wed, 12 Apr 2017 14:38:55 +0000 (16:38 +0200)
lib/pleroma/web/twitter_api/twitter_api_controller.ex
test/web/twitter_api/twitter_api_controller_test.exs

index f2c893e96d3c5c08ef886471de614eb0a0de32c9..c3a58b63a8dee40ea04e76ebb1bf329e9118f25a 100644 (file)
@@ -44,7 +44,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
   end
 
   def follow(%{assigns: %{user: user}} = conn, %{ "user_id" => followed_id }) do
-    { :ok, _user, follower, _activity } = TwitterAPI.follow(user, followed_id)
+    { :ok, user, follower, _activity } = TwitterAPI.follow(user, followed_id)
 
     response = follower |> UserRepresenter.to_json(%{for: user})
 
index 5aad12593e3e0ac4d87a90edad6410aca04d4593..7c75ff757e6a47c03b0f189b915f348815efa17c 100644 (file)
@@ -127,7 +127,7 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
 
       current_user = Repo.get(User, current_user.id)
       assert current_user.following == [User.ap_followers(followed)]
-      assert json_response(conn, 200) == UserRepresenter.to_map(followed)
+      assert json_response(conn, 200) == UserRepresenter.to_map(followed, %{for: current_user})
     end
   end
 
@@ -150,7 +150,7 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
 
       current_user = Repo.get(User, current_user.id)
       assert current_user.following == []
-      assert json_response(conn, 200) == UserRepresenter.to_map(followed)
+      assert json_response(conn, 200) == UserRepresenter.to_map(followed, %{for: current_user})
     end
   end