diff options
| author | Egor Kislitsyn <egor@kislitsyn.com> | 2019-05-07 16:51:11 +0700 |
|---|---|---|
| committer | Egor Kislitsyn <egor@kislitsyn.com> | 2019-05-07 16:51:11 +0700 |
| commit | 1557b99beb3b406572ef2d3baaabed1c9baeca1c (patch) | |
| tree | 34041b8526ecfa38fcb0b471718de0b3b71aa8c4 /test/web/mastodon_api/status_view_test.exs | |
| parent | c157e27a000a12dc8f660c056744a6611beb01b1 (diff) | |
| parent | 6518644db1d31f2b30b95fa0899b3751bc330d56 (diff) | |
| download | pleroma-1557b99beb3b406572ef2d3baaabed1c9baeca1c.tar.gz pleroma-1557b99beb3b406572ef2d3baaabed1c9baeca1c.zip | |
Merge remote-tracking branch 'pleroma/develop' into feature/disable-account
Diffstat (limited to 'test/web/mastodon_api/status_view_test.exs')
| -rw-r--r-- | test/web/mastodon_api/status_view_test.exs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs index f74726212..5fddc6c58 100644 --- a/test/web/mastodon_api/status_view_test.exs +++ b/test/web/mastodon_api/status_view_test.exs @@ -6,6 +6,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do use Pleroma.DataCase alias Pleroma.Activity + alias Pleroma.Bookmark alias Pleroma.Object alias Pleroma.Repo alias Pleroma.User @@ -153,6 +154,25 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do assert status.muted == true end + test "tells if the status is bookmarked" do + user = insert(:user) + + {:ok, activity} = CommonAPI.post(user, %{"status" => "Cute girls doing cute things"}) + status = StatusView.render("status.json", %{activity: activity}) + + assert status.bookmarked == false + + status = StatusView.render("status.json", %{activity: activity, for: user}) + + assert status.bookmarked == false + + {:ok, _bookmark} = Bookmark.create(user.id, activity.id) + + status = StatusView.render("status.json", %{activity: activity, for: user}) + + assert status.bookmarked == true + end + test "a reply" do note = insert(:note_activity) user = insert(:user) |
