diff --git a/lib/chess_web/templates/game/board.html.leex b/lib/chess_web/templates/game/board.html.leex index c5d3ede..caa9f78 100644 --- a/lib/chess_web/templates/game/board.html.leex +++ b/lib/chess_web/templates/game/board.html.leex @@ -37,5 +37,7 @@ <% end %> -
+diff --git a/lib/chess_web/templates/profile/edit.html.eex b/lib/chess_web/templates/profile/edit.html.eex index a8b335a..94cad6c 100644 --- a/lib/chess_web/templates/profile/edit.html.eex +++ b/lib/chess_web/templates/profile/edit.html.eex @@ -1,7 +1,7 @@
diff --git a/lib/chess_web/views/game_view.ex b/lib/chess_web/views/game_view.ex index 1d99066..f16e365 100644 --- a/lib/chess_web/views/game_view.ex +++ b/lib/chess_web/views/game_view.ex @@ -37,7 +37,9 @@ defmodule ChessWeb.GameView do end def your_turn?(conn, game) do - player_colour(conn, game) == game.turn + conn + |> current_user() + |> player_colour(game) == game.turn end def player_colour(conn, game) do diff --git a/test/chess_web/controllers/game_controller_test.exs b/test/chess_web/controllers/game_controller_test.exs index 4815394..59b290f 100644 --- a/test/chess_web/controllers/game_controller_test.exs +++ b/test/chess_web/controllers/game_controller_test.exs @@ -60,7 +60,7 @@ defmodule ChessWeb.GameControllerTest do |> login(user) |> get(game_path(conn, :show, game)) - assert html_response(conn, 200) =~ "