X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Fcommon_api%2Fcommon_api_test.exs;h=b80523160eca66bdf4f85d05c3cf44874a332396;hb=d1c7f8e576e31487544b57d67802843b8ef38388;hp=11f7c068f803b33d47aeaa06f9e65c3f039c7e0b;hpb=6875ccb6bfcc5ae62db26d38c3d5eac4c6f8706a;p=akkoma diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index 11f7c068f..b80523160 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2019 Pleroma Authors +# Copyright © 2017-2020 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.CommonAPITest do @@ -68,6 +68,7 @@ defmodule Pleroma.Web.CommonAPITest do har = insert(:user) jafnhar = insert(:user) tridi = insert(:user) + Pleroma.Config.put([:instance, :safe_dm_mentions], true) {:ok, activity} = @@ -201,13 +202,15 @@ defmodule Pleroma.Web.CommonAPITest do CommonAPI.post(user, %{"status" => ""}) end - test "it returns error when character limit is exceeded" do + test "it validates character limits are correctly enforced" do Pleroma.Config.put([:instance, :limit], 5) user = insert(:user) assert {:error, "The status is over the character limit"} = CommonAPI.post(user, %{"status" => "foobar"}) + + assert {:ok, activity} = CommonAPI.post(user, %{"status" => "12345"}) end test "it can handle activities that expire" do