diff options
author | rinpatch <rinpatch@sdf.org> | 2020-02-02 14:55:06 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-02-02 14:55:06 +0300 |
commit | 50f5a920219d6637582a1998fd33ec4552e02e9c (patch) | |
tree | 34eb27d4bb841063db0752541b2ad752d34cb390 /test/web/common_api | |
parent | c27d1d65bfd60effdb45359697141c136e156177 (diff) | |
download | pleroma-50f5a920219d6637582a1998fd33ec4552e02e9c.tar.gz |
fix not being able to pin polls
Diffstat (limited to 'test/web/common_api')
-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) |