Fix direct comparison E2E expectation

This commit is contained in:
Daniel Schädler 2026-04-12 17:48:12 +02:00
parent eedafe1276
commit a484ed164f
1 changed files with 5 additions and 2 deletions

View File

@ -93,11 +93,14 @@ RSpec.describe 'Tournament lifecycle HTTP E2E' do
received_points: 1 received_points: 1
) )
else else
expected_first_group_points = direct_result == :lost ? 9 : 6
expected_second_group_points = direct_result == :lost ? 6 : 6
expect(ordered_scores[0].slice(:team_name, :position, :group_points, :difference_in_points, :scored_points, :received_points)) expect(ordered_scores[0].slice(:team_name, :position, :group_points, :difference_in_points, :scored_points, :received_points))
.to eq( .to eq(
team_name: expected_positions[0] == 1 ? 'G1-S1' : 'G1-S2', team_name: expected_positions[0] == 1 ? 'G1-S1' : 'G1-S2',
position: 1, position: 1,
group_points: 6, group_points: expected_first_group_points,
difference_in_points: 3, difference_in_points: 3,
scored_points: 5, scored_points: 5,
received_points: 2 received_points: 2
@ -106,7 +109,7 @@ RSpec.describe 'Tournament lifecycle HTTP E2E' do
.to eq( .to eq(
team_name: expected_positions[0] == 1 ? 'G1-S2' : 'G1-S1', team_name: expected_positions[0] == 1 ? 'G1-S2' : 'G1-S1',
position: 2, position: 2,
group_points: 6, group_points: expected_second_group_points,
difference_in_points: 3, difference_in_points: 3,
scored_points: 5, scored_points: 5,
received_points: 2 received_points: 2