analytics/test/plausible_web/views/error_view_test.exs
Vini Brasil 257fa16cdc
Simplify Phoenix error template (#2913)
* Simplify Phoenix error template

* Test tracking script is not included in error pages

* Test tracking script is not rendered in error templates

* Rename error layout and remove unnecessary HTML boilerplate

* Add layout setting to errors rendered without exceptions

* Add skip_plausible_tracking option to more pages
2023-05-16 10:52:17 +02:00

14 lines
419 B
Elixir

defmodule PlausibleWeb.ErrorViewTest do
use PlausibleWeb.ConnCase, async: false
test "renders 500.html", %{conn: conn} do
conn = get(conn, "/test")
layout = Application.get_env(:plausible, PlausibleWeb.Endpoint)[:render_errors][:layout]
error_html =
Phoenix.View.render_to_string(PlausibleWeb.ErrorView, "500.html", conn: conn, layout: layout)
refute error_html =~ "data-domain="
end
end