list_view_test.exs (585B)
1 # Pleroma: A lightweight social networking server 2 # Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/> 3 # SPDX-License-Identifier: AGPL-3.0-only 4 5 defmodule Pleroma.Web.MastodonAPI.ListViewTest do 6 use Pleroma.DataCase 7 import Pleroma.Factory 8 alias Pleroma.Web.MastodonAPI.ListView 9 10 test "Represent a list" do 11 user = insert(:user) 12 title = "mortal enemies" 13 {:ok, list} = Pleroma.List.create(title, user) 14 15 expected = %{ 16 id: to_string(list.id), 17 title: title 18 } 19 20 assert expected == ListView.render("list.json", %{list: list}) 21 end 22 end