diff options
author | lain <lain@soykaf.club> | 2019-02-27 16:52:03 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-02-27 16:52:03 +0100 |
commit | 9ade1242c20acae5d27785deb833b453628b12ee (patch) | |
tree | d878dc86d32d3873c610441814676914c00fb4b8 /test/web/twitter_api | |
parent | c1ae495878cc95d09a051cc56e2bf7dc7ed0a032 (diff) | |
download | pleroma-9ade1242c20acae5d27785deb833b453628b12ee.tar.gz |
Add user muted status info to twitterapi.
Diffstat (limited to 'test/web/twitter_api')
-rw-r--r-- | test/web/twitter_api/views/activity_view_test.exs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/web/twitter_api/views/activity_view_test.exs b/test/web/twitter_api/views/activity_view_test.exs index 4f854ecaa..0a5384f34 100644 --- a/test/web/twitter_api/views/activity_view_test.exs +++ b/test/web/twitter_api/views/activity_view_test.exs @@ -56,6 +56,22 @@ defmodule Pleroma.Web.TwitterAPI.ActivityViewTest do assert result["user"]["id"] == user.id 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 = ActivityView.render("activity.json", %{activity: activity}) + + assert status["muted"] == false + + status = ActivityView.render("activity.json", %{activity: activity, for: user}) + + assert status["muted"] == true + end + test "a create activity with a html status" do text = """ #Bike log - Commute Tuesday\nhttps://pla.bike/posts/20181211/\n#cycling #CHScycling #commute\nMVIMG_20181211_054020.jpg @@ -149,7 +165,8 @@ defmodule Pleroma.Web.TwitterAPI.ActivityViewTest do "uri" => activity.data["object"]["id"], "user" => UserView.render("show.json", %{user: user}), "visibility" => "direct", - "card" => nil + "card" => nil, + "muted" => false } assert result == expected |