CommonAPITest: Add test that deactivated users can't post.
authorlain <lain@soykaf.club>
Tue, 4 Aug 2020 12:08:12 +0000 (14:08 +0200)
committerlain <lain@soykaf.club>
Tue, 4 Aug 2020 12:08:12 +0000 (14:08 +0200)
test/web/common_api/common_api_test.exs

index 313dda21b491006786b01aa2beef24b62e476fc8..4ba6232dc7dafe2b3f59fb13e49ec7c95f5b9149 100644 (file)
@@ -458,6 +458,11 @@ defmodule Pleroma.Web.CommonAPITest do
   end
 
   describe "posting" do
+    test "deactivated users can't post" do
+      user = insert(:user, deactivated: true)
+      assert {:error, _} = CommonAPI.post(user, %{status: "ye"})
+    end
+
     test "it supports explicit addressing" do
       user = insert(:user)
       user_two = insert(:user)