modifications to fix basic tests, many still need implementing
This commit is contained in:
parent
085f226cfe
commit
75eb9aa316
15 changed files with 234 additions and 216 deletions
test/shift73k_web/controllers
|
@ -7,9 +7,10 @@ defmodule Shift73kWeb.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 </h2>"
|
||||
assert response =~ "Log in\n</a>"
|
||||
assert response =~ "Register\n</a>"
|
||||
assert response =~ "Register</h2>"
|
||||
assert response =~ "Register</button>"
|
||||
assert response =~ "Log in</a>"
|
||||
assert response =~ "Forgot your password?</a>"
|
||||
end
|
||||
|
||||
test "redirects if already logged in", %{conn: conn} do
|
||||
|
|
|
@ -11,9 +11,10 @@ defmodule Shift73kWeb.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 </h2>"
|
||||
assert response =~ "Register\n</a>"
|
||||
assert response =~ "Log in\n</a>"
|
||||
assert response =~ "Log in</h2>"
|
||||
assert response =~ "Log in</button>"
|
||||
assert response =~ "Register</a>"
|
||||
assert response =~ "Forgot your password?</a>"
|
||||
end
|
||||
|
||||
test "redirects if already logged in", %{conn: conn, user: user} do
|
||||
|
@ -34,6 +35,8 @@ defmodule Shift73kWeb.UserSessionControllerTest do
|
|||
|
||||
# Now do a logged in request and assert on the menu
|
||||
conn = get(conn, "/")
|
||||
assert redirected_to(conn) =~ "/assign"
|
||||
conn = get(conn, "/assign")
|
||||
response = html_response(conn, 200)
|
||||
assert response =~ user.email
|
||||
assert response =~ "Settings\n</a>"
|
||||
|
@ -61,7 +64,7 @@ defmodule Shift73kWeb.UserSessionControllerTest do
|
|||
})
|
||||
|
||||
response = html_response(conn, 200)
|
||||
assert response =~ "\n Log in\n </h2>"
|
||||
assert response =~ "Log in</h2>"
|
||||
assert response =~ "Invalid email or password"
|
||||
end
|
||||
end
|
||||
|
@ -80,6 +83,8 @@ defmodule Shift73kWeb.UserSessionControllerTest do
|
|||
|
||||
# Now do a logged in request and assert on the menu
|
||||
conn = get(conn, "/")
|
||||
assert redirected_to(conn) =~ "/assign"
|
||||
conn = get(conn, "/assign")
|
||||
response = html_response(conn, 200)
|
||||
assert response =~ user.email
|
||||
assert response =~ "Settings\n</a>"
|
||||
|
@ -108,7 +113,7 @@ defmodule Shift73kWeb.UserSessionControllerTest do
|
|||
})
|
||||
|
||||
response = html_response(conn, 200)
|
||||
assert response =~ "\n Log in\n </h2>"
|
||||
assert response =~ "Log in</h2>"
|
||||
assert response =~ "Invalid email or password"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -10,7 +10,7 @@ defmodule Shift73kWeb.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</h2>"
|
||||
assert response =~ "User Settings</h2>"
|
||||
end
|
||||
|
||||
test "redirects if user is not logged in" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue