towerops/test/towerops_web/controllers/user_registration_html_test.exs

29 lines
805 B
Elixir

defmodule ToweropsWeb.UserRegistrationHTMLTest do
use ToweropsWeb.ConnCase, async: true
import Phoenix.Component, only: [to_form: 2]
import Phoenix.Template, only: [render_to_string: 4]
alias Towerops.Accounts
alias Towerops.Accounts.User
describe "new.html" do
test "renders registration form" do
changeset = Accounts.change_user_registration(%User{})
form = to_form(changeset, as: "user")
html =
render_to_string(ToweropsWeb.UserRegistrationHTML, "new", "html",
flash: %{},
current_scope: nil,
form: form
)
assert html =~ "Register for an account"
assert html =~ "Already registered?"
assert html =~ "Log in"
assert html =~ "Create an account"
assert html =~ "Password"
end
end
end