diff options
author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2019-09-04 11:26:34 +0000 |
---|---|---|
committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2019-09-04 11:26:34 +0000 |
commit | e72531bfacb2399ad0783a26b1c23f0bba24a107 (patch) | |
tree | 69fc553ac7aa2520c726a69b6d11bedfc8a66a82 /test | |
parent | e54694748bdcc27a3acd3ff3feac5c0c284d8b0d (diff) | |
parent | 3face454671bfdf2b850daf9dcb05468eb909e95 (diff) | |
download | pleroma-e72531bfacb2399ad0783a26b1c23f0bba24a107.tar.gz |
Merge branch 'feat/mastoapi-status-threadmuted' into 'develop'
Mastodon API: Add `pleroma.thread_muted` to Status entity
See merge request pleroma/pleroma!1626
Diffstat (limited to 'test')
-rw-r--r-- | test/web/mastodon_api/views/status_view_test.exs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/test/web/mastodon_api/views/status_view_test.exs b/test/web/mastodon_api/views/status_view_test.exs index 1b6beb6d2..90451cbdc 100644 --- a/test/web/mastodon_api/views/status_view_test.exs +++ b/test/web/mastodon_api/views/status_view_test.exs @@ -150,7 +150,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do content: %{"text/plain" => HtmlSanitizeEx.strip_tags(object_data["content"])}, spoiler_text: %{"text/plain" => HtmlSanitizeEx.strip_tags(object_data["summary"])}, expires_at: nil, - direct_conversation_id: nil + direct_conversation_id: nil, + thread_muted: false } } @@ -173,6 +174,24 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do assert status.muted == true end + test "tells if the message is thread muted" 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, for: user}) + + assert status.pleroma.thread_muted == false + + {:ok, activity} = CommonAPI.add_mute(user, activity) + + status = StatusView.render("status.json", %{activity: activity, for: user}) + + assert status.pleroma.thread_muted == true + end + test "tells if the status is bookmarked" do user = insert(:user) |