1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

8 man double elim cross brackets in the semis not quarter finals

This commit is contained in:
2020-01-31 12:51:06 -05:00
parent fb9039e4d0
commit 9dae57e141
4 changed files with 23 additions and 23 deletions

View File

@@ -54,8 +54,8 @@ class DoubleEliminationEightManMatchGeneration < ActionDispatch::IntegrationTest
match4 = @tournament.matches.select{|match| match.round == 1 and match.bracket_position_number == 4}.first
assert @tournament.matches.select{|m| m.bracket_position == "Conso Quarter" && m.bracket_position_number == 1}.first.loser1_name == "BYE"
assert @tournament.matches.select{|m| m.bracket_position == "Conso Quarter" && m.bracket_position_number == 1}.first.loser2_name == "Loser of #{match3.bout_number}"
assert @tournament.matches.select{|m| m.bracket_position == "Conso Quarter" && m.bracket_position_number == 2}.first.loser1_name == "Loser of #{match2.bout_number}"
assert @tournament.matches.select{|m| m.bracket_position == "Conso Quarter" && m.bracket_position_number == 1}.first.loser2_name == "Loser of #{match2.bout_number}"
assert @tournament.matches.select{|m| m.bracket_position == "Conso Quarter" && m.bracket_position_number == 2}.first.loser1_name == "Loser of #{match3.bout_number}"
assert @tournament.matches.select{|m| m.bracket_position == "Conso Quarter" && m.bracket_position_number == 2}.first.loser2_name == "BYE"
semis1 = @tournament.matches.select{|match| match.bracket_position == "Semis" and match.bracket_position_number == 1}.first
@@ -63,8 +63,8 @@ class DoubleEliminationEightManMatchGeneration < ActionDispatch::IntegrationTest
consosemis1 = @tournament.matches.select{|match| match.bracket_position == "Conso Semis" and match.bracket_position_number == 1}.first
consosemis2 = @tournament.matches.select{|match| match.bracket_position == "Conso Semis" and match.bracket_position_number == 2}.first
assert consosemis1.loser1_name == "Loser of #{semis1.bout_number}"
assert consosemis2.loser1_name == "Loser of #{semis2.bout_number}"
assert consosemis1.loser1_name == "Loser of #{semis2.bout_number}"
assert consosemis2.loser1_name == "Loser of #{semis1.bout_number}"
assert @tournament.matches.select{|m| m.bracket_position == "5/6" && m.bracket_position_number == 1}.first.loser1_name == "Loser of #{consosemis1.bout_number}"
assert @tournament.matches.select{|m| m.bracket_position == "5/6" && m.bracket_position_number == 1}.first.loser2_name == "Loser of #{consosemis2.bout_number}"

View File

@@ -31,17 +31,17 @@ class DoubleEliminationRunThrough < ActionDispatch::IntegrationTest
conso_quarter = matches.select{|m| m.bracket_position == "Conso Quarter"}.sort_by{|m| m.bracket_position_number}
assert conso_quarter.first.reload.loser1_name == "BYE"
assert conso_quarter.first.reload.wrestler2.name == "Test6"
assert conso_quarter.second.reload.wrestler1.name == "Test5"
assert conso_quarter.first.reload.wrestler2.name == "Test5"
assert conso_quarter.second.reload.wrestler1.name == "Test6"
assert conso_quarter.second.reload.loser2_name == "BYE"
conso_semis = matches.select{|m| m.bracket_position == "Conso Semis"}.sort_by{|m| m.bracket_position_number}
assert conso_semis.first.reload.wrestler1.name == "Test1"
assert conso_semis.first.reload.wrestler2.name == "Test6"
assert conso_semis.second.reload.wrestler1.name == "Test3"
assert conso_semis.second.reload.wrestler2.name == "Test5"
winner_by_name("Test1",conso_semis.first)
winner_by_name("Test5",conso_semis.second)
assert conso_semis.first.reload.wrestler1.name == "Test3"
assert conso_semis.first.reload.wrestler2.name == "Test5"
assert conso_semis.second.reload.wrestler1.name == "Test1"
assert conso_semis.second.reload.wrestler2.name == "Test6"
winner_by_name("Test5",conso_semis.first)
winner_by_name("Test1",conso_semis.second)
first_finals = matches.select{|m| m.bracket_position == "1/2"}.first
third_finals = matches.select{|m| m.bracket_position == "3/4"}.first
@@ -50,11 +50,11 @@ class DoubleEliminationRunThrough < ActionDispatch::IntegrationTest
assert first_finals.reload.wrestler1.name == "Test4"
assert first_finals.reload.wrestler2.name == "Test2"
assert third_finals.reload.wrestler1.name == "Test1"
assert third_finals.reload.wrestler2.name == "Test5"
assert third_finals.reload.wrestler1.name == "Test5"
assert third_finals.reload.wrestler2.name == "Test1"
assert fifth_finals.reload.wrestler1.name == "Test6"
assert fifth_finals.reload.wrestler2.name == "Test3"
assert fifth_finals.reload.wrestler1.name == "Test3"
assert fifth_finals.reload.wrestler2.name == "Test6"
# DEBUG
# matches.sort_by{|m| m.bout_number}.each do |match|