Skip to content

Commit 830fff2

Browse files
committed
test: fix 404 tests that need game started_at set
1 parent e8c5ce1 commit 830fff2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

copi.owasp.org/test/copi_web/controllers/api_controller_test.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ defmodule CopiWeb.ApiControllerTest do
5858
end
5959

6060
test "play_card returns 404 when dealt card not found for player", %{conn: conn, game: game} do
61+
{:ok, _} = Cornucopia.update_game(game, %{started_at: DateTime.truncate(DateTime.utc_now(), :second)})
6162
{:ok, other_game} = Cornucopia.create_game(%{name: "Other Game"})
6263
{:ok, other_player} = Cornucopia.create_player(%{name: "Other", game_id: other_game.id})
6364
{:ok, card2} = Cornucopia.create_card(%{
@@ -124,6 +125,7 @@ defmodule CopiWeb.ApiControllerTest do
124125
end
125126

126127
test "play_card returns 404 when player_id doesn't belong to game", %{conn: conn, game: game} do
128+
{:ok, _} = Cornucopia.update_game(game, %{started_at: DateTime.truncate(DateTime.utc_now(), :second)})
127129
conn = put(conn, "/api/games/#{game.id}/players/99999/card", %{
128130
"game_id" => game.id,
129131
"player_id" => "99999",

0 commit comments

Comments
 (0)