diff --git a/lib/chess_web/controllers/session_controller.ex b/lib/chess_web/controllers/session_controller.ex index 9959837..1c9c54f 100644 --- a/lib/chess_web/controllers/session_controller.ex +++ b/lib/chess_web/controllers/session_controller.ex @@ -18,7 +18,7 @@ defmodule ChessWeb.SessionController do {:ok, user} -> conn |> Guardian.Plug.sign_in(user) - |> put_flash(:info, "You are signed in") + |> put_flash(:info, "You are logged in") |> redirect(to: game_path(conn, :index)) {:error, _error} -> changeset = User.changeset(%User{}) diff --git a/lib/chess_web/templates/session/new.html.eex b/lib/chess_web/templates/session/new.html.eex index 235fed1..1079eac 100644 --- a/lib/chess_web/templates/session/new.html.eex +++ b/lib/chess_web/templates/session/new.html.eex @@ -1,4 +1,4 @@ -

Sign in

+

Log in

<%= form_for @changeset, session_path(@conn, :create), [class: "create-session"], fn f -> %> <%= if @changeset.action do %> @@ -16,6 +16,6 @@
- <%= submit "Sign in", class: "btn btn-primary" %> + <%= submit "Log in", class: "btn btn-primary" %>
<% end %> diff --git a/test/chess_web/controllers/session_controller_test.exs b/test/chess_web/controllers/session_controller_test.exs index 0222894..bb19e56 100644 --- a/test/chess_web/controllers/session_controller_test.exs +++ b/test/chess_web/controllers/session_controller_test.exs @@ -1,8 +1,8 @@ defmodule Chess.SessionControllerTest do use ChessWeb.ConnCase - test "shows sign in form", %{conn: conn} do + test "shows log in form", %{conn: conn} do conn = get conn, session_path(conn, :new) - assert html_response(conn, 200) =~ "Sign in" + assert html_response(conn, 200) =~ "Log in" end end diff --git a/test/features/games_test.exs b/test/features/games_test.exs index c13f466..665a98e 100644 --- a/test/features/games_test.exs +++ b/test/features/games_test.exs @@ -41,7 +41,7 @@ defmodule Chess.GamesTest do |> visit("/session/new") |> fill_in(text_field("Username"), with: "link@hyrule.kingdom") |> fill_in(text_field("Password"), with: "ilovezelda") - |> click(button("Sign in")) + |> click(button("Log in")) end defp create_user() do diff --git a/test/features/session_test.exs b/test/features/session_test.exs index f6eaa1a..d8fa144 100644 --- a/test/features/session_test.exs +++ b/test/features/session_test.exs @@ -5,7 +5,7 @@ defmodule Chess.SessionTest do import Wallaby.Query, only: [text_field: 1, link: 1, button: 1] - test "user cannot sign in with incorrect username", %{session: session} do + test "user cannot log in with incorrect username", %{session: session} do create_user() session @@ -13,12 +13,12 @@ defmodule Chess.SessionTest do |> click(link("Log in")) |> fill_in(text_field("Username"), with: "link@example.com") |> fill_in(text_field("Password"), with: "ilovezelda") - |> click(button("Sign in")) + |> click(button("Log in")) assert session |> has_text?("Bad username or password") end - test "user cannot sign in with incorrect password", %{session: session} do + test "user cannot log in with incorrect password", %{session: session} do create_user() session @@ -26,12 +26,12 @@ defmodule Chess.SessionTest do |> click(link("Log in")) |> fill_in(text_field("Username"), with: "link@hyrule.kingdom") |> fill_in(text_field("Password"), with: "calamityganon") - |> click(button("Sign in")) + |> click(button("Log in")) assert session |> has_text?("Bad username or password") end - test "user can sign in with correct details", %{session: session} do + test "user can log in with correct details", %{session: session} do create_user() session @@ -39,14 +39,14 @@ defmodule Chess.SessionTest do |> click(link("Log in")) |> fill_in(text_field("Username"), with: "link@hyrule.kingdom") |> fill_in(text_field("Password"), with: "ilovezelda") - |> click(button("Sign in")) + |> click(button("Log in")) - assert session |> has_text?("You are signed in") + assert session |> has_text?("You are logged in") assert session |> has_text?("Listing games") assert session |> has_text?("link@hyrule.kingdom") end - test "user can sign out", %{session: session} do + test "user can log out", %{session: session} do create_user() session @@ -54,7 +54,7 @@ defmodule Chess.SessionTest do |> click(link("Log in")) |> fill_in(text_field("Username"), with: "link@hyrule.kingdom") |> fill_in(text_field("Password"), with: "ilovezelda") - |> click(button("Sign in")) + |> click(button("Log in")) session |> visit("/")