fixed tests

This commit is contained in:
Kieran Eglin 2024-08-23 11:42:19 -07:00
parent 3f7f36724c
commit e1fd4eceb0
No known key found for this signature in database
GPG key ID: 193984967FCF432D
2 changed files with 5 additions and 5 deletions

View file

@ -16,14 +16,14 @@
</ul> </ul>
<textarea class="w-full min-h-96 font-mono inline-block rounded-lg" readonly> <textarea class="w-full min-h-96 font-mono inline-block rounded-lg" readonly>
**Status**: **Status**:
`<%= @status %>` `<%= if Map.has_key?(assigns, :status), do: @status, else: "" %>`
**Reason**: **Reason**:
`<%= inspect(@reason) %>` `<%= if Map.has_key?(assigns, :reason), do: inspect(@reason), else: "" %>`
**Stacktrace**: **Stacktrace**:
``` ```
<%= Exception.format_stacktrace(@stack) %> <%= if Map.has_key?(assigns, :stack), do: Exception.format_stacktrace(@stack), else: "" %>
``` ```
</textarea> </textarea>
</section> </section>

View file

@ -5,10 +5,10 @@ defmodule PinchflatWeb.ErrorHTMLTest do
import Phoenix.Template import Phoenix.Template
test "renders 404.html" do test "renders 404.html" do
assert render_to_string(PinchflatWeb.ErrorHTML, "404", "html", []) == "Not Found" assert render_to_string(PinchflatWeb.ErrorHTML, "404", "html", []) =~ "404 (not found)"
end end
test "renders 500.html" do test "renders 500.html" do
assert render_to_string(PinchflatWeb.ErrorHTML, "500", "html", []) == "Internal Server Error" assert render_to_string(PinchflatWeb.ErrorHTML, "500", "html", []) =~ "Internal Server Error"
end end
end end