X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Fweb%2Ftwitter_api%2Ftwitter_api_test.exs;h=715a746ef7805bc26a82f62653670bfb8d639cbb;hb=c1d529ee9491fc0040cd4327c783aabf76cb66a8;hp=ac62880d5244ad2b6f85e9b0317921cb233feb60;hpb=52200998c997576c9008cbe50b0a7b9f0e6134cc;p=akkoma
diff --git a/test/web/twitter_api/twitter_api_test.exs b/test/web/twitter_api/twitter_api_test.exs
index ac62880d5..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)
@@ -247,7 +247,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
user = insert(:user)
User.block(user, unblocked)
- {:ok, user, unblocked} = TwitterAPI.unblock(user, %{"user_id" => unblocked.id})
+ {:ok, user, _unblocked} = TwitterAPI.unblock(user, %{"user_id" => unblocked.id})
assert user.info["blocks"] == []
end
@@ -256,7 +256,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
user = insert(:user)
User.block(user, unblocked)
- {:ok, user, unblocked} = TwitterAPI.unblock(user, %{"screen_name" => unblocked.nickname})
+ {:ok, user, _unblocked} = TwitterAPI.unblock(user, %{"screen_name" => unblocked.nickname})
assert user.info["blocks"] == []
end
@@ -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)