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

index 4d6d1dc97f11a798b2d386c8b1ac3607967b78f9,1e5204db8442955e544f1125ed65fd5c1176000a..67b47163d3067eb86e1066647f2c0899f9ce672a
@@@ -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)