From: dtluna Date: Sun, 16 Apr 2017 14:13:42 +0000 (+0300) Subject: Merge branch 'develop' of ssh.gitgud.io:lambadalambda/pleroma into feature/unfollow... X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=f6547f7b7fa72a9730773012394c522ac6b17398;p=akkoma Merge branch 'develop' of ssh.gitgud.io:lambadalambda/pleroma into feature/unfollow-by-screen-name --- f6547f7b7fa72a9730773012394c522ac6b17398 diff --cc test/web/twitter_api/twitter_api_test.exs index 821bdebbe,1e5204db8..3d16a2049 --- a/test/web/twitter_api/twitter_api_test.exs +++ b/test/web/twitter_api/twitter_api_test.exs @@@ -125,22 -125,11 +125,22 @@@ defmodule Pleroma.Web.TwitterAPI.Twitte assert follow == activity end - test "Unfollow another user" do + test "Unfollow another user using user_id" do - { :ok, following } = UserBuilder.insert(%{nickname: "guy"}) - { :ok, user } = UserBuilder.insert(%{following: [User.ap_followers(following)]}) + following = insert(:user) + user = insert(:user, %{following: [User.ap_followers(following)]}) - {:ok, user, _following } = TwitterAPI.unfollow(user, following.id) + {:ok, user, _following } = TwitterAPI.unfollow(user, %{"user_id" => following.id}) + + user = Repo.get(User, user.id) + + assert user.following == [] + end + + test "Unfollow another user using screen_name" do - { :ok, following } = UserBuilder.insert(%{nickname: "guy"}) - { :ok, user } = UserBuilder.insert(%{following: [User.ap_followers(following)]}) ++ following = insert(:user) ++ user = insert(:user, %{following: [User.ap_followers(following)]}) + + {:ok, user, _following } = TwitterAPI.unfollow(user, %{"screen_name" => following.nickname}) user = Repo.get(User, user.id)