summaryrefslogtreecommitdiff
path: root/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2020-10-02 21:00:50 +0400
committerEgor Kislitsyn <egor@kislitsyn.com>2020-10-15 18:37:44 +0400
commit4f79bbbc31c10c1d55c9fee4002f36ef16b95dbf (patch)
tree1ae138def7d6828c71f2d478060b9be8de90bdc0 /test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
parentb48724afcdd9d46d6533aafdea4df1cc2d23b6ae (diff)
Add local-only statuses
Diffstat (limited to 'test/pleroma/web/mastodon_api/controllers/status_controller_test.exs')
-rw-r--r--test/pleroma/web/mastodon_api/controllers/status_controller_test.exs19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
index 61359214a..b047f183d 100644
--- a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
+++ b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
@@ -1740,4 +1740,23 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|> get("/api/v1/statuses/#{activity.id}")
|> json_response_and_validate_schema(:ok)
end
+
+ test "posting a local only status" do
+ %{user: _user, conn: conn} = oauth_access(["write:statuses"])
+
+ conn_one =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/v1/statuses", %{
+ "status" => "cofe",
+ "local_only" => "true"
+ })
+
+ local = Pleroma.Web.base_url() <> "/#Public"
+
+ assert %{"content" => "cofe", "id" => id, "pleroma" => %{"local_only" => true}} =
+ json_response(conn_one, 200)
+
+ assert %Activity{id: ^id, data: %{"to" => [^local]}} = Activity.get_by_id(id)
+ end
end