diff options
author | rinpatch <rinpatch@sdf.org> | 2020-02-05 21:04:16 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-02-05 21:04:16 +0000 |
commit | 15cb1f6804fde19330a3c1f06eb24802c7503be3 (patch) | |
tree | dbbf1cc80b1361080444d82e96c84113c10a2edd /test/web/common_api/common_api_test.exs | |
parent | 72d767998c389ea4c9896d8748b0529d134bd8a6 (diff) | |
parent | 50f5a920219d6637582a1998fd33ec4552e02e9c (diff) | |
download | pleroma-15cb1f6804fde19330a3c1f06eb24802c7503be3.tar.gz pleroma-15cb1f6804fde19330a3c1f06eb24802c7503be3.zip |
Merge branch 'fix/unpinnable-polls' into 'develop'
fix not being able to pin polls
See merge request pleroma/pleroma!2172
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r-- | test/web/common_api/common_api_test.exs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index 8fa0c6faa..214cbdd7c 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -324,6 +324,21 @@ defmodule Pleroma.Web.CommonAPITest do assert %User{pinned_activities: [^id]} = user end + test "pin poll", %{user: user} do + {:ok, activity} = + CommonAPI.post(user, %{ + "status" => "How is fediverse today?", + "poll" => %{"options" => ["Absolutely outstanding", "Not good"], "expires_in" => 20} + }) + + assert {:ok, ^activity} = CommonAPI.pin(activity.id, user) + + id = activity.id + user = refresh_record(user) + + assert %User{pinned_activities: [^id]} = user + end + test "unlisted statuses can be pinned", %{user: user} do {:ok, activity} = CommonAPI.post(user, %{"status" => "HI!!!", "visibility" => "unlisted"}) assert {:ok, ^activity} = CommonAPI.pin(activity.id, user) |