X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Ftwitter_api%2Ftwitter_api_test.exs;h=adea67422c08a608c0eb6f0d5bf4a8288b83b9bb;hb=d00571ff75567aa43618f660205faeac6e9485fb;hp=da880e67c5652e6b8d5dc6a94b69b20d6f6f73d7;hpb=1af9c777365f3b54edcb572cea4e2e6f185b3099;p=akkoma diff --git a/test/web/twitter_api/twitter_api_test.exs b/test/web/twitter_api/twitter_api_test.exs index da880e67c..adea67422 100644 --- a/test/web/twitter_api/twitter_api_test.exs +++ b/test/web/twitter_api/twitter_api_test.exs @@ -34,7 +34,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do { :ok, activity = %Activity{} } = TwitterAPI.create_status(user, input) - assert get_in(activity.data, ["object", "content"]) == "Hello again, @shp.
\nThis is on another line. #2hu #epic #phantasmagoric
\nimage.jpg" + assert get_in(activity.data, ["object", "content"]) == "Hello again, @shp.
\nThis is on another line. #2hu #epic #phantasmagoric
\nimage.jpg" 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 @@ -353,10 +353,15 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do describe "fetching a user by uri" do test "fetches a user by uri" do + id = "https://mastodon.social/users/lambadalambda" user = insert(:user) + {:ok, represented} = TwitterAPI.get_external_profile(user, id) + remote = User.get_by_ap_id(id) - {:ok, represented} = TwitterAPI.get_external_profile(user, user.ap_id) - assert represented = UserRepresenter.to_map(user, %{for: user}) + assert represented == UserRepresenter.to_map(remote, %{for: user}) + + # Also fetches the feed. + assert Activity.get_create_activity_by_object_ap_id("tag:mastodon.social,2017-04-05:objectId=1641750:objectType=Status") end end end