From: dtluna Date: Sun, 16 Apr 2017 14:12:28 +0000 (+0300) Subject: Merge branch 'develop' of ssh.gitgud.io:lambadalambda/pleroma into feature/follow... X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=82914e1e4de37747653c83644b428c1ba29428c9;p=akkoma Merge branch 'develop' of ssh.gitgud.io:lambadalambda/pleroma into feature/follow-by-screen-name --- 82914e1e4de37747653c83644b428c1ba29428c9 diff --cc test/web/twitter_api/twitter_api_test.exs index 4d6d1dc97,1e5204db8..67b47163d --- a/test/web/twitter_api/twitter_api_test.exs +++ b/test/web/twitter_api/twitter_api_test.exs @@@ -106,24 -112,11 +112,24 @@@ defmodule Pleroma.Web.TwitterAPI.Twitte assert status == ActivityRepresenter.to_map(activity, %{for: user, user: actor}) end - test "Follow another user" do + test "Follow another user using user_id" do - { :ok, user } = UserBuilder.insert - { :ok, following } = UserBuilder.insert(%{nickname: "guy"}) + user = insert(:user) + following = insert(:user) - {:ok, user, following, activity } = TwitterAPI.follow(user, following.id) + {:ok, user, following, activity } = TwitterAPI.follow(user, %{"user_id" => following.id}) + + user = Repo.get(User, user.id) + follow = Repo.get(Activity, activity.id) + + assert user.following == [User.ap_followers(following)] + assert follow == activity + end + + test "Follow another user using screen_name" do - { :ok, user } = UserBuilder.insert - { :ok, following } = UserBuilder.insert(%{nickname: "guy"}) ++ user = insert(:user) ++ following = insert(:user) + + {:ok, user, following, activity } = TwitterAPI.follow(user, %{"screen_name" => following.nickname}) user = Repo.get(User, user.id) follow = Repo.get(Activity, activity.id)