Default new endgames to rating 1500

Closes #17
This commit is contained in:
2026-11-02 21:26:19 +01:00
parent 7658450573
commit 6d0d750ca7
3 changed files with 43 additions and 1 deletions
+8
View File
@@ -150,6 +150,14 @@ defmodule Chesstrainer.EndgamesTest do
end
end
describe "rating default" do
test "a new endgame changeset defaults rating to 1500" do
changeset = Endgames.change_endgame(%Endgame{})
assert Ecto.Changeset.get_field(changeset, :rating) == 1500
end
end
describe "listing and filtering" do
test "list_keys/0 returns the distinct keys sorted" do
create_endgame!(@kr)