aboutsummaryrefslogtreecommitdiff
path: root/test/views/error_view_test.exs
blob: cd5390ae816d9dec85bd8b3c06de8e314d0ba6b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
defmodule TheTranscriberBackend.ErrorViewTest do
  use TheTranscriberBackend.ConnCase, async: true

  # Bring render/3 and render_to_string/3 for testing custom views
  import Phoenix.View

  test "renders 404.html" do
    assert render_to_string(TheTranscriberBackend.ErrorView, "404.html", []) ==
           "Page not found"
  end

  test "render 500.html" do
    assert render_to_string(TheTranscriberBackend.ErrorView, "500.html", []) ==
           "Internal server error"
  end

  test "render any other" do
    assert render_to_string(TheTranscriberBackend.ErrorView, "505.html", []) ==
           "Internal server error"
  end
end