X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Fmastodon_api%2Fmastodon_api_controller_test.exs;h=fc00105695bcce4219a90b0d76c41acd4caa67a3;hb=4b06e46a3a97d6a14c7013fa952eade08ff7aef5;hp=a00a11f8b46aec3929c58fcfc377ef3f499e521c;hpb=1cca544e206e8e7f38077fba6392c252803c13ec;p=akkoma diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index a00a11f8b..fc0010569 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -56,6 +56,17 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do assert Repo.get(Activity, id) end + test "posting a sensitive status", %{conn: conn} do + user = insert(:user) + + conn = conn + |> assign(:user, user) + |> post("/api/v1/statuses", %{"status" => "cofe", "sensitive" => true}) + + assert %{"content" => "cofe", "id" => id, "sensitive" => true} = json_response(conn, 200) + assert Repo.get(Activity, id) + end + test "replying to a status", %{conn: conn} do user = insert(:user) @@ -562,4 +573,19 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do assert user["header"] != "https://placehold.it/700x335" end end + + test "get instance information" do + insert(:user, %{local: true}) + user = insert(:user, %{local: true}) + insert(:user, %{local: false}) + + {:ok, _} = TwitterAPI.create_status(user, %{"status" => "cofe"}) + + conn = conn + |> get("/api/v1/instance") + + assert result = json_response(conn, 200) + + assert result["stats"]["user_count"] == 2 + end end