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

Added quick create high school girls weight classes

This commit is contained in:
2021-02-18 20:27:44 +00:00
parent 5677f4e944
commit 0aea26967a
5 changed files with 28 additions and 11 deletions

View File

@@ -11,4 +11,20 @@ class TournamentTest < ActiveSupport::TestCase
assert_not tourney.valid?
assert_equal [:date, :name, :tournament_type, :address, :director, :director_email], tourney.errors.attribute_names
end
test "Tournament create_pre_defined_weights High School Boys Weights" do
tournament = Tournament.find(1)
tournament.create_pre_defined_weights(Weight::HS_WEIGHT_CLASSES.split(","))
Weight::HS_WEIGHT_CLASSES.split(",").each do |weight|
assert tournament.weights.select{|w| w.max == weight.to_i}.count == 1
end
end
test "Tournament create_pre_defined_weights High School Girls Weights" do
tournament = Tournament.find(1)
tournament.create_pre_defined_weights(Weight::HS_GIRLS_WEIGHT_CLASSES.split(","))
Weight::HS_GIRLS_WEIGHT_CLASSES.split(",").each do |weight|
assert tournament.weights.select{|w| w.max == weight.to_i}.count == 1
end
end
end