Changed the bidding round status field from "running" to "stopped".

This commit is contained in:
2026-02-12 11:00:14 +01:00
parent 647da6c9d7
commit e01042130e
6 changed files with 43 additions and 20 deletions

View File

@ -8,7 +8,7 @@ defmodule BeetRoundServer.BiddingRoundsTest do
import BeetRoundServer.BiddingRoundsFixtures
@invalid_attrs %{running: nil, round_number: nil}
@invalid_attrs %{stopped: nil, round_number: nil}
test "list_bidding_rounds/0 returns all bidding_rounds" do
bidding_round = bidding_round_fixture()
@ -21,10 +21,12 @@ defmodule BeetRoundServer.BiddingRoundsTest do
end
test "create_bidding_round/1 with valid data creates a bidding_round" do
valid_attrs = %{running: true, round_number: 42}
valid_attrs = %{stopped: true, round_number: 42}
assert {:ok, %BiddingRound{} = bidding_round} = BiddingRounds.create_bidding_round(valid_attrs)
assert bidding_round.running == true
assert {:ok, %BiddingRound{} = bidding_round} =
BiddingRounds.create_bidding_round(valid_attrs)
assert bidding_round.stopped == true
assert bidding_round.round_number == 42
end
@ -34,23 +36,31 @@ defmodule BeetRoundServer.BiddingRoundsTest do
test "update_bidding_round/2 with valid data updates the bidding_round" do
bidding_round = bidding_round_fixture()
update_attrs = %{running: false, round_number: 43}
update_attrs = %{stopped: false, round_number: 43}
assert {:ok, %BiddingRound{} = bidding_round} = BiddingRounds.update_bidding_round(bidding_round, update_attrs)
assert bidding_round.running == false
assert {:ok, %BiddingRound{} = bidding_round} =
BiddingRounds.update_bidding_round(bidding_round, update_attrs)
assert bidding_round.stopped == false
assert bidding_round.round_number == 43
end
test "update_bidding_round/2 with invalid data returns error changeset" do
bidding_round = bidding_round_fixture()
assert {:error, %Ecto.Changeset{}} = BiddingRounds.update_bidding_round(bidding_round, @invalid_attrs)
assert {:error, %Ecto.Changeset{}} =
BiddingRounds.update_bidding_round(bidding_round, @invalid_attrs)
assert bidding_round == BiddingRounds.get_bidding_round!(bidding_round.id)
end
test "delete_bidding_round/1 deletes the bidding_round" do
bidding_round = bidding_round_fixture()
assert {:ok, %BiddingRound{}} = BiddingRounds.delete_bidding_round(bidding_round)
assert_raise Ecto.NoResultsError, fn -> BiddingRounds.get_bidding_round!(bidding_round.id) end
assert_raise Ecto.NoResultsError, fn ->
BiddingRounds.get_bidding_round!(bidding_round.id)
end
end
test "change_bidding_round/1 returns a bidding_round changeset" do