X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Flist_test.exs;h=b5572cbae916368be2a744299933334219aa936a;hb=06444a150174ebd5a811057d068beb2da8727753;hp=f39033d022d7c58f32ba379ddae54bbc52cdf859;hpb=ffb4eb9779ddd28ecee84c06e8dc58f4a4daaa38;p=akkoma
diff --git a/test/list_test.exs b/test/list_test.exs
index f39033d02..b5572cbae 100644
--- a/test/list_test.exs
+++ b/test/list_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2018 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.ListTest do
@@ -15,6 +15,13 @@ defmodule Pleroma.ListTest do
assert title == "title"
end
+ test "validates title" do
+ user = insert(:user)
+
+ assert {:error, changeset} = Pleroma.List.create("", user)
+ assert changeset.errors == [title: {"can't be blank", [validation: :required]}]
+ end
+
test "getting a list not belonging to the user" do
user = insert(:user)
other_user = insert(:user)
@@ -106,10 +113,10 @@ defmodule Pleroma.ListTest do
{:ok, not_owned_list} = Pleroma.List.follow(not_owned_list, member_1)
{:ok, not_owned_list} = Pleroma.List.follow(not_owned_list, member_2)
- lists_1 = Pleroma.List.get_lists_account_belongs(owner, member_1.id)
+ lists_1 = Pleroma.List.get_lists_account_belongs(owner, member_1)
assert owned_list in lists_1
refute not_owned_list in lists_1
- lists_2 = Pleroma.List.get_lists_account_belongs(owner, member_2.id)
+ lists_2 = Pleroma.List.get_lists_account_belongs(owner, member_2)
assert owned_list in lists_2
refute not_owned_list in lists_2
end