Add test for UserRegistrationHTML
Added test to cover the new.html registration form template. This improves UserRegistrationHTML coverage from 0% to 100%.
This commit is contained in:
parent
29c8e1a8d3
commit
a430d09668
1 changed files with 25 additions and 0 deletions
|
|
@ -0,0 +1,25 @@
|
|||
defmodule ToweropsWeb.UserRegistrationHTMLTest do
|
||||
use ToweropsWeb.ConnCase, async: true
|
||||
|
||||
import Phoenix.Template, only: [render_to_string: 4]
|
||||
|
||||
alias Towerops.Accounts.User
|
||||
|
||||
describe "new.html" do
|
||||
test "renders registration form" do
|
||||
changeset = User.email_changeset(%User{}, %{})
|
||||
|
||||
html =
|
||||
render_to_string(ToweropsWeb.UserRegistrationHTML, "new", "html",
|
||||
flash: %{},
|
||||
current_scope: nil,
|
||||
changeset: changeset
|
||||
)
|
||||
|
||||
assert html =~ "Register for an account"
|
||||
assert html =~ "Already registered?"
|
||||
assert html =~ "Log in"
|
||||
assert html =~ "Create an account"
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue