diff options
author | Tusooa Zhu <tusooa@kazv.moe> | 2022-06-03 21:47:40 -0400 |
---|---|---|
committer | Tusooa Zhu <tusooa@kazv.moe> | 2022-06-03 21:47:40 -0400 |
commit | 3249ac1f12b69718cacc193c020e8bdccf167a9e (patch) | |
tree | 2492fe93b62ffcebfa353c70e0556b3f1c713c4d /test | |
parent | fdaa8640838c741500839f66fc7902c88d449afd (diff) | |
download | pleroma-3249ac1f12b69718cacc193c020e8bdccf167a9e.tar.gz pleroma-3249ac1f12b69718cacc193c020e8bdccf167a9e.zip |
Show edited_at in MastodonAPI/show
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/web/mastodon_api/views/status_view_test.exs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/pleroma/web/mastodon_api/views/status_view_test.exs b/test/pleroma/web/mastodon_api/views/status_view_test.exs index 5d81c92b9..44cc003f3 100644 --- a/test/pleroma/web/mastodon_api/views/status_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/status_view_test.exs @@ -246,6 +246,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do content: HTML.filter_tags(object_data["content"]), text: nil, created_at: created_at, + edited_at: nil, reblogs_count: 0, replies_count: 0, favourites_count: 0, @@ -708,4 +709,19 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do status = StatusView.render("show.json", activity: visible, for: poster) assert status.pleroma.parent_visible end + + test "it shows edited_at" do + poster = insert(:user) + + {:ok, post} = CommonAPI.post(poster, %{status: "hey"}) + + status = StatusView.render("show.json", activity: post) + refute status.edited_at + + {:ok, _} = CommonAPI.update(poster, post, %{status: "mew mew"}) + edited = Pleroma.Activity.normalize(post) + + status = StatusView.render("show.json", activity: edited) + assert status.edited_at + end end |