mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-30 19:22:21 +00:00
Merge branch 'development'
This commit is contained in:
@@ -124,6 +124,14 @@ class Wrestler < ActiveRecord::Base
|
||||
pool_matches = allMatches.select{|m| m.bracket_position == "Pool"}
|
||||
pool_matches.select{|m| m.poolNumber == self.generatePoolNumber}
|
||||
end
|
||||
|
||||
def hasAPoolBye
|
||||
if weight.poolRounds(allMatches) > poolMatches.size
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
def championshipAdvancementWins
|
||||
matchesWon.select{|m| m.bracket_position == "Quarter" or m.bracket_position == "Semis"}
|
||||
|
||||
@@ -34,7 +34,11 @@ class CalculateWrestlerTeamScore
|
||||
|
||||
def poolPoints
|
||||
if @tournament.tournament_type == "Pool to bracket"
|
||||
(@wrestler.poolWins.size * 2)
|
||||
if @wrestler.poolWins.size >= 1 and @wrestler.hasAPoolBye == true
|
||||
((@wrestler.poolWins.size * 2) + 2)
|
||||
else
|
||||
(@wrestler.poolWins.size * 2)
|
||||
end
|
||||
else
|
||||
0
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
FROM ruby:2.3.0
|
||||
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get clean && apt-get update
|
||||
RUN apt-get -y upgrade
|
||||
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential libssl-dev libyaml-dev libreadline-dev openssl curl git-core zlib1g-dev bison libxml2-dev libxslt1-dev libcurl4-openssl-dev libsqlite3-dev sqlite3 wget apache2 apt-transport-https nodejs nodejs-legacy npm mysql-client postfix
|
||||
|
||||
@@ -402,7 +402,7 @@ class PoolAdvancementTest < ActionDispatch::IntegrationTest
|
||||
wrestler1 = Wrestler.where("name = ?", "Guy2").first
|
||||
wrestler2 = Wrestler.where("name = ?", "Guy3").first
|
||||
#Won four in pool
|
||||
assert_equal 20, wrestler1.totalTeamPoints
|
||||
assert_equal 22, wrestler1.totalTeamPoints
|
||||
#Won two in pool
|
||||
assert_equal 16, wrestler2.totalTeamPoints
|
||||
end
|
||||
@@ -466,25 +466,25 @@ class PoolAdvancementTest < ActionDispatch::IntegrationTest
|
||||
test "bonus points major" do
|
||||
endMatchWithMajor(2002,"Guy2")
|
||||
wrestler1 = Wrestler.where("name = ?", "Guy2").first
|
||||
assert_equal 3, wrestler1.teamPointsEarned
|
||||
assert_equal 5, wrestler1.teamPointsEarned
|
||||
end
|
||||
|
||||
test "bonus points pin" do
|
||||
endMatchWithPin(2002,"Guy2")
|
||||
wrestler1 = Wrestler.where("name = ?", "Guy2").first
|
||||
assert_equal 4, wrestler1.teamPointsEarned
|
||||
assert_equal 6, wrestler1.teamPointsEarned
|
||||
end
|
||||
|
||||
test "bonus points tech fall" do
|
||||
endMatchWithTech(2002,"Guy2")
|
||||
wrestler1 = Wrestler.where("name = ?", "Guy2").first
|
||||
assert_equal 3.5, wrestler1.teamPointsEarned
|
||||
assert_equal 5.5, wrestler1.teamPointsEarned
|
||||
end
|
||||
|
||||
test "pool team points win" do
|
||||
endMatch(2002,"Guy2")
|
||||
wrestler1 = Wrestler.where("name = ?", "Guy2").first
|
||||
assert_equal 2, wrestler1.teamPointsEarned
|
||||
assert_equal 4, wrestler1.teamPointsEarned
|
||||
end
|
||||
|
||||
test "advancement points fourPoolsToQuarter Quarter" do
|
||||
@@ -558,10 +558,10 @@ class PoolAdvancementTest < ActionDispatch::IntegrationTest
|
||||
|
||||
test "Conso bracket wins are 1pt" do
|
||||
elevenManBracketToSemis
|
||||
assert_equal 5, Wrestler.where("name = ?", "Guy17").first.teamPointsEarned
|
||||
assert_equal 7, Wrestler.where("name = ?", "Guy17").first.teamPointsEarned
|
||||
|
||||
endMatch(5006,"Guy17")
|
||||
assert_equal 9, Wrestler.where("name = ?", "Guy17").first.teamPointsEarned
|
||||
assert_equal 11, Wrestler.where("name = ?", "Guy17").first.teamPointsEarned
|
||||
end
|
||||
|
||||
test "One pool placement points" do
|
||||
|
||||
Reference in New Issue
Block a user