1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.ErrorViewTest do
6 use Pleroma.Web.ConnCase, async: true
8 # Bring render/3 and render_to_string/3 for testing custom views
11 test "renders 404.json" do
12 assert render(Pleroma.Web.ErrorView, "404.json", []) == %{errors: %{detail: "Page not found"}}
15 test "render 500.json" do
16 assert render(Pleroma.Web.ErrorView, "500.json", []) ==
17 %{errors: %{detail: "Internal server error"}}
20 test "render any other" do
21 assert render(Pleroma.Web.ErrorView, "505.json", []) ==
22 %{errors: %{detail: "Internal server error"}}