Merge branch 'develop' of ssh.gitgud.io:lambadalambda/pleroma into feature/unfollow...
authordtluna <dtluna@openmailbox.org>
Sun, 16 Apr 2017 14:13:42 +0000 (17:13 +0300)
committerdtluna <dtluna@openmailbox.org>
Sun, 16 Apr 2017 14:13:42 +0000 (17:13 +0300)
1  2 
lib/pleroma/web/twitter_api/twitter_api_controller.ex
test/web/twitter_api/twitter_api_test.exs

index 821bdebbef5c024838a26ce1d943316740104dff,1e5204db8442955e544f1125ed65fd5c1176000a..3d16a20495fd54263d220896ef370f363a547194
@@@ -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)