diff options
author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2019-01-31 10:16:11 +0000 |
---|---|---|
committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2019-01-31 10:16:11 +0000 |
commit | 00d43333735acbcadc1dd04ff793f4ce6e8eecb1 (patch) | |
tree | 27959dec7a5ae46c194ed7b47156e4877a736a0b /test/user_test.exs | |
parent | 5f40f4f74d96da7b54394e8d6fa29f00cd0c63fd (diff) | |
parent | cda1470e02100bfcdcbd128fd08d0af64dca7271 (diff) | |
download | pleroma-00d43333735acbcadc1dd04ff793f4ce6e8eecb1.tar.gz |
Merge branch 'features/glitch-soc-frontend' into 'develop'
Features/glitch soc frontend
See merge request pleroma/pleroma!192
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 cd202e360..9815c4d5a 100644 --- a/test/user_test.exs +++ b/test/user_test.exs @@ -951,4 +951,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 |