1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.MastodonAPI.ListViewTest do
6 use Pleroma.DataCase, async: true
8 alias Pleroma.Web.MastodonAPI.ListView
12 title = "mortal enemies"
13 {:ok, list} = Pleroma.List.create(title, user)
16 id: to_string(list.id),
20 assert expected == ListView.render("show.json", %{list: list})
26 {:ok, list} = Pleroma.List.create("my list", user)
27 {:ok, list2} = Pleroma.List.create("cofe", user)
29 assert [%{id: _, title: "my list"}, %{id: _, title: "cofe"}] =
30 ListView.render("index.json", lists: [list, list2])