X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=inline;f=test%2Fweb%2Ftwitter_api%2Ftwitter_api_test.exs;h=715a746ef7805bc26a82f62653670bfb8d639cbb;hb=e30752bc79d9e03a64c83a7990a7afdcb0176a07;hp=4aec995755008ea0b6c1c0a3994c1ec99e9232bf;hpb=b331cb449a46bbead19fea4fba59762c1a2e3a10;p=akkoma
diff --git a/test/web/twitter_api/twitter_api_test.exs b/test/web/twitter_api/twitter_api_test.exs
index 4aec99575..715a746ef 100644
--- a/test/web/twitter_api/twitter_api_test.exs
+++ b/test/web/twitter_api/twitter_api_test.exs
@@ -34,13 +34,14 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
{ :ok, activity = %Activity{} } = TwitterAPI.create_status(user, input)
- assert get_in(activity.data, ["object", "content"]) == "Hello again, @shp.<script></script>
This is on another :moominmamma: line. #2hu #epic #phantasmagoric
image.jpg"
+ expected_text = "Hello again, @shp.<script></script>
This is on another :moominmamma: line. #2hu #epic #phantasmagoric
image.jpg"
+ assert get_in(activity.data, ["object", "content"]) == expected_text
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
- assert Enum.member?(get_in(activity.data, ["to"]), User.ap_followers(user))
+ assert Enum.member?(get_in(activity.data, ["cc"]), User.ap_followers(user))
assert Enum.member?(get_in(activity.data, ["to"]), "https://www.w3.org/ns/activitystreams#Public")
- assert Enum.member?(get_in(activity.data, ["to"]), "shp")
+ assert Enum.member?(get_in(activity.data, ["cc"]), "shp")
assert activity.local == true
assert %{"moominmamma" => "http://localhost:4001/finmoji/128px/moominmamma-128.png"} = activity.data["object"]["emoji"]
@@ -80,7 +81,6 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
assert get_in(reply.data, ["object", "context"]) == get_in(activity.data, ["object", "context"])
assert get_in(reply.data, ["object", "inReplyTo"]) == get_in(activity.data, ["object", "id"])
assert get_in(reply.data, ["object", "inReplyToStatusId"]) == activity.id
- assert Enum.member?(get_in(reply.data, ["to"]), user.ap_id)
end
test "fetch public statuses, excluding remote ones." do
@@ -99,7 +99,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
%{ public: activity, user: user } = ActivityBuilder.public_and_non_public
insert(:note_activity, %{local: false})
- follower = insert(:user, following: [User.ap_followers(user)])
+ follower = insert(:user, following: [user.follower_address])
statuses = TwitterAPI.fetch_public_and_external_statuses(follower)
@@ -283,19 +283,6 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
assert is_binary(response)
end
- test "it adds user links to an existing text" do
- text = "@gsimg According to @archaeme, that is @daggsy. Also hello @archaeme@archae.me"
-
- gsimg = insert(:user, %{nickname: "gsimg"})
- archaeme = insert(:user, %{nickname: "archaeme"})
- archaeme_remote = insert(:user, %{nickname: "archaeme@archae.me"})
-
- mentions = Pleroma.Formatter.parse_mentions(text)
- expected_text = "@gsimg According to @archaeme, that is @daggsy. Also hello @archaeme"
-
- assert Utils.add_user_links(text, mentions) == expected_text
- end
-
test "it favorites a status, returns the updated status" do
user = insert(:user)
note_activity = insert(:note_activity)