diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2018-09-19 02:04:56 +0200 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2019-01-28 04:47:32 +0100 |
commit | cda1470e02100bfcdcbd128fd08d0af64dca7271 (patch) | |
tree | cf140f85c95843af594c35fb2e4edf615cb4af6e /test/user_test.exs | |
parent | 872241d7c50a5c92f7867b89672ca451b40d44da (diff) | |
download | pleroma-cda1470e02100bfcdcbd128fd08d0af64dca7271.tar.gz |
[MastoAPI][GlitchAPI] Add bookmarks
Diffstat (limited to 'test/user_test.exs')
-rw-r--r-- | test/user_test.exs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/user_test.exs b/test/user_test.exs index a0657c7b6..b33398ff6 100644 --- a/test/user_test.exs +++ b/test/user_test.exs @@ -945,4 +945,31 @@ defmodule Pleroma.UserTest do assert expected_text == User.parse_bio(bio, user) end end + + test "bookmarks" do + user = insert(:user) + + {:ok, activity1} = + CommonAPI.post(user, %{ + "status" => "heweoo!" + }) + + id1 = activity1.data["object"]["id"] + + {:ok, activity2} = + CommonAPI.post(user, %{ + "status" => "heweoo!" + }) + + id2 = activity2.data["object"]["id"] + + assert {:ok, user_state1} = User.bookmark(user, id1) + assert user_state1.bookmarks == [id1] + + assert {:ok, user_state2} = User.unbookmark(user, id1) + assert user_state2.bookmarks == [] + + assert {:ok, user_state3} = User.bookmark(user, id2) + assert user_state3.bookmarks == [id2] + end end |