aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-02-27 16:46:47 +0100
committerlain <lain@soykaf.club>2019-02-27 16:46:47 +0100
commitc1ae495878cc95d09a051cc56e2bf7dc7ed0a032 (patch)
treebe4bd948be6a8d0fdac6ba349a35671eae0d6f9d /test
parentc4235f96bde49def1fb6927ba79a49a0f75cd60a (diff)
downloadpleroma-c1ae495878cc95d09a051cc56e2bf7dc7ed0a032.tar.gz
Add user muted status info to MastodonAPI.
Diffstat (limited to 'test')
-rw-r--r--test/web/mastodon_api/status_view_test.exs16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs
index 3412a6be2..351dbf673 100644
--- a/test/web/mastodon_api/status_view_test.exs
+++ b/test/web/mastodon_api/status_view_test.exs
@@ -126,6 +126,22 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
assert status == expected
end
+ test "tells if the message is muted for some reason" do
+ user = insert(:user)
+ other_user = insert(:user)
+
+ {:ok, user} = User.mute(user, other_user)
+
+ {:ok, activity} = CommonAPI.post(other_user, %{"status" => "test"})
+ status = StatusView.render("status.json", %{activity: activity})
+
+ assert status.muted == false
+
+ status = StatusView.render("status.json", %{activity: activity, for: user})
+
+ assert status.muted == true
+ end
+
test "a reply" do
note = insert(:note_activity)
user = insert(:user)