diff options
| author | Thibaut Girka <thib@sitedethib.com> | 2019-10-01 19:08:25 +0200 | 
|---|---|---|
| committer | Thibaut Girka <thib@sitedethib.com> | 2019-10-01 20:38:29 +0200 | 
| commit | 7d5a9f3f6d393c744364148568cfb9b0249789fc (patch) | |
| tree | 53d44d0b78ccbbd7879d1b337a0cd34b656305de /test/web/mastodon_api | |
| parent | 4c1f158f5de95581f1489be32614e0e75bc77ba4 (diff) | |
| download | pleroma-7d5a9f3f6d393c744364148568cfb9b0249789fc.tar.gz pleroma-7d5a9f3f6d393c744364148568cfb9b0249789fc.zip | |
Add tests for privately announcing statuses via API
Diffstat (limited to 'test/web/mastodon_api')
| -rw-r--r-- | test/web/mastodon_api/controllers/status_controller_test.exs | 18 | 
1 files changed, 18 insertions, 0 deletions
| diff --git a/test/web/mastodon_api/controllers/status_controller_test.exs b/test/web/mastodon_api/controllers/status_controller_test.exs index b194feae6..727a233e7 100644 --- a/test/web/mastodon_api/controllers/status_controller_test.exs +++ b/test/web/mastodon_api/controllers/status_controller_test.exs @@ -547,6 +547,24 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do        assert to_string(activity.id) == id      end +    test "reblogs privately and returns the reblogged status", %{conn: conn} do +      activity = insert(:note_activity) +      user = insert(:user) + +      conn = +        conn +        |> assign(:user, user) +        |> post("/api/v1/statuses/#{activity.id}/reblog", %{"visibility" => "private"}) + +      assert %{ +               "reblog" => %{"id" => id, "reblogged" => true, "reblogs_count" => 0}, +               "reblogged" => true, +               "visibility" => "private" +             } = json_response(conn, 200) + +      assert to_string(activity.id) == id +    end +      test "reblogged status for another user", %{conn: conn} do        activity = insert(:note_activity)        user1 = insert(:user) | 
