mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Created integration test for poolbracket matchups
This commit is contained in:
@@ -7,7 +7,7 @@ class Matchup
|
||||
hash
|
||||
end
|
||||
|
||||
def convert_to_obj(h)
|
||||
def convert_to_obj(h)
|
||||
h.each do |k,v|
|
||||
self.class.send(:attr_accessor, k)
|
||||
instance_variable_set("@#{k}", v)
|
||||
|
||||
@@ -31,10 +31,10 @@ class Tournament < ActiveRecord::Base
|
||||
def generateMatchups
|
||||
@matches = []
|
||||
self.weights.map.sort_by{|x|[x.max]}.each do |weight|
|
||||
@upcomingMatches = weight.generateMatchups(@matches)
|
||||
@matches = weight.generateMatchups(@matches)
|
||||
end
|
||||
@upcomingMatches = assignBouts(@upcomingMatches)
|
||||
return @upcomingMatches
|
||||
@matches = assignBouts(@matches)
|
||||
return @matches
|
||||
end
|
||||
|
||||
def assignBouts(matches)
|
||||
|
||||
@@ -92,9 +92,9 @@ class Weight < ActiveRecord::Base
|
||||
return "twoPoolsToSemi"
|
||||
elsif self.wrestlers.size > 8 && self.wrestlers.size <= 10
|
||||
return "twoPoolsToFinal"
|
||||
elsif self.wrestlers.size == 11
|
||||
elsif self.wrestlers.size == 11 || self.wrestlers.size == 12
|
||||
return "fourPoolsToQuarter"
|
||||
elsif self.wrestlers.size > 11 && self.wrestlers.size <= 16
|
||||
elsif self.wrestlers.size > 12 && self.wrestlers.size <= 16
|
||||
return "fourPoolsToSemi"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user