Merge branch 'develop' into dtluna/pleroma-feature/unfollow-activity
[akkoma] / test / web / twitter_api / twitter_api_test.exs
index 4e17f3298f6b421389981d8c54559b9dc6402487..9a7dc48dab42e472cd90e1413f21b8dd8509eb37 100644 (file)
@@ -33,7 +33,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
 
     { :ok, activity = %Activity{} } = TwitterAPI.create_status(user, input)
 
-    assert get_in(activity.data, ["object", "content"]) == "Hello again, <a href='shp'>@shp</a>.<br>This is on another line."
+    assert get_in(activity.data, ["object", "content"]) == "Hello again, <a href='shp'>@shp</a>.<br>This is on another line.<br><a href='http://example.org/image.jpg'>http://example.org/image.jpg</a>"
     assert get_in(activity.data, ["object", "type"]) == "Note"
     assert get_in(activity.data, ["object", "actor"]) == user.ap_id
     assert get_in(activity.data, ["actor"]) == user.ap_id
@@ -190,6 +190,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
   test "Unfollow another user using user_id" do
     unfollowed = insert(:user)
     user = insert(:user, %{following: [User.ap_followers(unfollowed)]})
+    ActivityPub.follow(user, unfollowed)
 
     {:ok, user, unfollowed } = TwitterAPI.unfollow(user, %{"user_id" => unfollowed.id})
     assert user.following == []
@@ -202,6 +203,8 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
     unfollowed = insert(:user)
     user = insert(:user, %{following: [User.ap_followers(unfollowed)]})
 
+    ActivityPub.follow(user, unfollowed)
+
     {:ok, user, unfollowed } = TwitterAPI.unfollow(user, %{"screen_name" => unfollowed.nickname})
     assert user.following == []