diff options
Diffstat (limited to 'test/web')
| -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)  | 
