From 15655d992e8ba2aa8d4680eb38a8d3039b58703a Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Wed, 12 Apr 2017 16:38:55 +0200 Subject: [PATCH] Fix user representation after following. --- lib/pleroma/web/twitter_api/twitter_api_controller.ex | 2 +- test/web/twitter_api/twitter_api_controller_test.exs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pleroma/web/twitter_api/twitter_api_controller.ex b/lib/pleroma/web/twitter_api/twitter_api_controller.ex index f2c893e96..c3a58b63a 100644 --- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex +++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex @@ -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}) diff --git a/test/web/twitter_api/twitter_api_controller_test.exs b/test/web/twitter_api/twitter_api_controller_test.exs index 5aad12593..7c75ff757 100644 --- a/test/web/twitter_api/twitter_api_controller_test.exs +++ b/test/web/twitter_api/twitter_api_controller_test.exs @@ -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 -- 2.45.2