You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it 'creates a bye...' do
season = create(:season)
driver = described_class.new season
Team.create!(name: 'Team 1', season:)
Team.create!(name: 'Team 2', season:)
Team.create!(name: 'Team 3', season:)
TournamentSystem::RoundRobin.generate driver
expect(season.matches.count).to eq(1)
end
When I run this test, the test fails because the lib tries to create a second match record in which there is only a home_team but no away_team.
Is this the expected behavior?
Is it a best practice to create placeholder matches in this situation? I currently have a validation rule that requires matches to have two sides. I'm deciding whether it's better to remove it
The text was updated successfully, but these errors were encountered:
Yes, BYEs are generated on purpose and need to be kept track of. SWISS will for instance avoid giving the same team a BYE, but to do that it needs to know which team has had one.
Example situation where a bye happens:
When I run this test, the test fails because the lib tries to create a second match record in which there is only a
home_team
but noaway_team
.The text was updated successfully, but these errors were encountered: