style improvements and fixes

This commit is contained in:
Adam Piontek 2021-03-03 08:15:14 -05:00
parent ef7b8e0bb8
commit 0869d6a58c
21 changed files with 57 additions and 35 deletions

View file

@ -13,7 +13,7 @@ defmodule Bones73kWeb.UserConfirmationControllerTest do
test "renders the confirmation page", %{conn: conn} do
conn = get(conn, Routes.user_confirmation_path(conn, :new))
response = html_response(conn, 200)
assert response =~ "Resend confirmation instructions\n </h3>"
assert response =~ "Resend confirmation instructions\n </h2>"
end
end

View file

@ -7,7 +7,7 @@ defmodule Bones73kWeb.UserRegistrationControllerTest do
test "renders registration page", %{conn: conn} do
conn = get(conn, Routes.user_registration_path(conn, :new))
response = html_response(conn, 200)
assert response =~ "Register\n </h3>"
assert response =~ "Register\n </h2>"
assert response =~ "Log in\n</a>"
assert response =~ "Register\n</a>"
end

View file

@ -13,7 +13,7 @@ defmodule Bones73kWeb.UserResetPasswordControllerTest do
test "renders the reset password page", %{conn: conn} do
conn = get(conn, Routes.user_reset_password_path(conn, :new))
response = html_response(conn, 200)
assert response =~ "Forgot your password?\n </h3>"
assert response =~ "Forgot your password?\n </h2>"
end
test "redirects if already logged in", %{conn: conn} do
@ -61,7 +61,7 @@ defmodule Bones73kWeb.UserResetPasswordControllerTest do
test "renders reset password with user_id in session", %{conn: conn, token: token, user: user} do
conn = get(conn, Routes.user_reset_password_path(conn, :edit, token))
assert get_session(conn, "user_id") == user.id
assert html_response(conn, 200) =~ "Reset password\n </h3>"
assert html_response(conn, 200) =~ "Reset password\n </h2>"
end
test "does not render reset password with invalid token", %{conn: conn} do

View file

@ -11,7 +11,7 @@ defmodule Bones73kWeb.UserSessionControllerTest do
test "renders log in page", %{conn: conn} do
conn = get(conn, Routes.user_session_path(conn, :new))
response = html_response(conn, 200)
assert response =~ "\n Log in\n </h3>"
assert response =~ "\n Log in\n </h2>"
assert response =~ "Register\n</a>"
assert response =~ "Log in\n</a>"
end
@ -61,7 +61,7 @@ defmodule Bones73kWeb.UserSessionControllerTest do
})
response = html_response(conn, 200)
assert response =~ "\n Log in\n </h3>"
assert response =~ "\n Log in\n </h2>"
assert response =~ "Invalid email or password"
end
end
@ -108,7 +108,7 @@ defmodule Bones73kWeb.UserSessionControllerTest do
})
response = html_response(conn, 200)
assert response =~ "\n Log in\n </h3>"
assert response =~ "\n Log in\n </h2>"
assert response =~ "Invalid email or password"
end
end

View file

@ -10,7 +10,7 @@ defmodule Bones73kWeb.UserSettingsControllerTest do
test "renders settings page", %{conn: conn} do
conn = get(conn, Routes.user_settings_path(conn, :edit))
response = html_response(conn, 200)
assert response =~ "User Settings\n</h3>"
assert response =~ "User Settings\n</h2>"
end
test "redirects if user is not logged in" do

View file

@ -17,7 +17,7 @@ defmodule Bones73kWeb.UserLive.RegistrationTest do
test "displays registration form", %{conn: conn} do
{:ok, _view, html} = live_isolated(conn, Bones73kWeb.UserLive.Registration)
assert html =~ "Register\n </h3>"
assert html =~ "Register\n </h2>"
assert html =~ "Email</label>"
end
@ -29,7 +29,7 @@ defmodule Bones73kWeb.UserLive.RegistrationTest do
|> form("#reg_form", %{"user" => %{"email" => "abc", "password" => "abc"}})
|> render_change()
assert html =~ "Register\n </h3>"
assert html =~ "Register\n </h2>"
assert html =~ "must be a valid email address"
assert html =~ "should be at least #{User.min_password()} character(s)"
assert html =~ "type=\"submit\" disabled=\"disabled\""

View file

@ -17,7 +17,7 @@ defmodule Bones73kWeb.UserLive.ResetPasswordTest do
test "displays registration form", %{conn: conn, user: user} do
{:ok, _view, html} = live_isolated(conn, Bones73kWeb.UserLive.ResetPassword)
assert html =~ "Reset password\n </h3>"
assert html =~ "Reset password\n </h2>"
assert html =~ user.email
assert html =~ "New password</label>"
end
@ -28,7 +28,7 @@ defmodule Bones73kWeb.UserLive.ResetPasswordTest do
form_data = %{"user" => %{"password" => "abc", "password_confirmation" => "def"}}
html = form(view, "#pw_reset_form", form_data) |> render_change()
assert html =~ "Reset password\n </h3>"
assert html =~ "Reset password\n </h2>"
assert html =~ "should be at least #{User.min_password()} character(s)"
assert html =~ "does not match password"
assert html =~ "type=\"submit\" disabled=\"disabled\""