summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2019-07-09 10:18:30 -0500
committerMark Felder <feld@FreeBSD.org>2019-07-09 10:18:30 -0500
commit31a59d6f23d66f0f4221d2f036e727f22da17615 (patch)
tree230fcd3e5a02433c8f14dd40e0217cfcad54b02c /test/web/mastodon_api
parent98f13eac9e38c6ec44a7146cfc58114b0148f462 (diff)
parent376a55c97fcf178abec3091db830215642bf23c1 (diff)
downloadpleroma-31a59d6f23d66f0f4221d2f036e727f22da17615.tar.gz
pleroma-31a59d6f23d66f0f4221d2f036e727f22da17615.zip
Merge branch 'develop' into proxy-error
Diffstat (limited to 'test/web/mastodon_api')
-rw-r--r--test/web/mastodon_api/status_view_test.exs35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs
index ec75150ab..73791a95b 100644
--- a/test/web/mastodon_api/status_view_test.exs
+++ b/test/web/mastodon_api/status_view_test.exs
@@ -444,4 +444,39 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
assert Enum.at(result[:options], 2)[:votes_count] == 1
end
end
+
+ test "embeds a relationship in the account" do
+ user = insert(:user)
+ other_user = insert(:user)
+
+ {:ok, activity} =
+ CommonAPI.post(user, %{
+ "status" => "drink more water"
+ })
+
+ result = StatusView.render("status.json", %{activity: activity, for: other_user})
+
+ assert result[:account][:pleroma][:relationship] ==
+ AccountView.render("relationship.json", %{user: other_user, target: user})
+ end
+
+ test "embeds a relationship in the account in reposts" do
+ user = insert(:user)
+ other_user = insert(:user)
+
+ {:ok, activity} =
+ CommonAPI.post(user, %{
+ "status" => "˙˙ɐʎns"
+ })
+
+ {:ok, activity, _object} = CommonAPI.repeat(activity.id, other_user)
+
+ result = StatusView.render("status.json", %{activity: activity, for: user})
+
+ assert result[:account][:pleroma][:relationship] ==
+ AccountView.render("relationship.json", %{user: user, target: other_user})
+
+ assert result[:reblog][:account][:pleroma][:relationship] ==
+ AccountView.render("relationship.json", %{user: user, target: user})
+ end
end