diff options
| author | rinpatch <rinpatch@sdf.org> | 2019-04-27 23:06:46 +0300 |
|---|---|---|
| committer | rinpatch <rinpatch@sdf.org> | 2019-04-27 23:06:46 +0300 |
| commit | c3e9fcf098e4ec17a387fe264193dca4dda2dd77 (patch) | |
| tree | e569cce24843fb1751996727cc7aa66af14cadb1 /test/web/mastodon_api | |
| parent | 002ea343f8c6dc9669bce91942f835a2c7cc6ae7 (diff) | |
| download | pleroma-c3e9fcf098e4ec17a387fe264193dca4dda2dd77.tar.gz pleroma-c3e9fcf098e4ec17a387fe264193dca4dda2dd77.zip | |
Fix bookmarks depending on embeded object and move checking if the
status is bookmarked to SQL
Diffstat (limited to 'test/web/mastodon_api')
| -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) |
