Skip to content

Commit

Permalink
import only required function
Browse files Browse the repository at this point in the history
Based on hexdocs: https://hexdocs.pm/elixir/alias-require-and-import.html\#import it is recommended to only import the function you are using. This change proposes to just import `render_to_string` in the `error_html_test.exs` file
  • Loading branch information
yakov-cl committed Nov 6, 2024
1 parent 57b352b commit 427d840
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule <%= @web_namespace %>.ErrorHTMLTest do
use <%= @web_namespace %>.ConnCase, async: true

# Bring render_to_string/4 for testing custom views
import Phoenix.Template
import Phoenix.Template, only [render_to_string: 4]

test "renders 404.html" do
assert render_to_string(<%= @web_namespace %>.ErrorHTML, "404", "html", []) == "Not Found"
Expand Down

0 comments on commit 427d840

Please sign in to comment.