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

Fixed bug in single pool placement points and wrote tests

This commit is contained in:
2016-01-29 19:22:05 +00:00
parent 14058e6a6c
commit ac28af84a5
3 changed files with 45 additions and 4 deletions

View File

@@ -16,6 +16,25 @@ class PoolAdvancementTest < ActionDispatch::IntegrationTest
end
end
def singlePoolNotFinished
matches = @matches
endMatch(1000,"Jackson Lakso",matches)
endMatch(1001,"Jaden Mattox",matches)
endMatch(2000,"James Wimer",matches)
endMatch(2001,"Jaden Mattox",matches)
endMatch(3000,"Jaden Mattox",matches)
endMatch(3001,"James Wimer",matches)
endMatch(4000,"JD Woods",matches)
endMatch(4001,"James Wimer",matches)
endMatch(5000,"James Wimer",matches)
end
def singlePoolFinished
singlePoolNotFinished
matches = @matches
endMatch(5001,"Jackson Lakso",matches)
end
def sixteenManToSemi
matches = @matches
endMatch(1013,"Guy22",matches)
@@ -567,4 +586,24 @@ class PoolAdvancementTest < ActionDispatch::IntegrationTest
assert_equal 9, Wrestler.where("name = ?", "Guy17").first.teamPointsEarned
end
test "One pool placement points" do
singlePoolFinished
wrestler1 = Wrestler.where("name = ?", "James Wimer").first
wrestler2 = Wrestler.where("name = ?", "Jaden Mattox").first
wrestler3 = Wrestler.where("name = ?", "Jackson Lakso").first
wrestler4 = Wrestler.where("name = ?", "JD Woods").first
assert_equal 16, wrestler1.placementPoints
assert_equal 12, wrestler2.placementPoints
assert_equal 10, wrestler3.placementPoints
assert_equal 9, wrestler4.placementPoints
end
test "One pool placement points zero if pool not finished" do
singlePoolNotFinished
wrestler1 = Wrestler.where("name = ?", "James Wimer").first
assert_equal 0, wrestler1.placementPoints
end
end

View File

@@ -1,6 +1,7 @@
require 'test_helper'
class SingleTestTest < ActionDispatch::IntegrationTest
test "the truth" do
assert true
end