Skip to content

Fix Vote schema empty changeset validation#2628

Open
xovishnukosuri wants to merge 1 commit intoOWASP:masterfrom
xovishnukosuri:fix/vote-changeset-validation
Open

Fix Vote schema empty changeset validation#2628
xovishnukosuri wants to merge 1 commit intoOWASP:masterfrom
xovishnukosuri:fix/vote-changeset-validation

Conversation

@xovishnukosuri
Copy link

Summary

  • Updated Vote.changeset/2 to cast and validate [:dealt_card_id, :player_id] instead of empty lists
  • Added unit tests for the Vote changeset (valid and invalid attributes), following the existing ContinueVoteTest pattern

Closes #2557

Test plan

  • mix test test/copi/cornucopia/vote_test.exs passes (changeset accepts valid attrs, rejects nil values)
  • Existing test suite continues to pass (mix test)
  • Manual verification: voting in a live game session still works correctly

🤖 Generated with Claude Code

The Vote changeset was casting no fields and validating nothing,
violating Ecto best practices. Update to cast and require
:dealt_card_id and :player_id, matching the ContinueVote pattern.
Add corresponding unit tests.

Closes OWASP#2557

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vote schema has empty changeset with no validation/required fields.

1 participant