mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Fixed tournament error bug
This commit is contained in:
@@ -112,7 +112,12 @@ class Tournament < ActiveRecord::Base
|
||||
|
||||
def poolToBracketWeightsWithTooManyWrestlers
|
||||
if self.tournament_type == "Pool to bracket"
|
||||
weights.select{|w| w.wrestlers.size > 16}
|
||||
weightsWithTooManyWrestlers = weights.select{|w| w.wrestlers.size > 16}
|
||||
if weightsWithTooManyWrestlers.size < 1
|
||||
return nil
|
||||
else
|
||||
return weightsWithTooManyWrestlers
|
||||
end
|
||||
else
|
||||
nil
|
||||
end
|
||||
|
||||
@@ -56,21 +56,18 @@ include Devise::TestHelpers
|
||||
end
|
||||
|
||||
test "logged in tournament owner can generate matches" do
|
||||
wipe
|
||||
sign_in_owner
|
||||
get :generate_matches, id: 1
|
||||
success
|
||||
end
|
||||
|
||||
test "logged in non tournament owner cannot generate matches" do
|
||||
wipe
|
||||
sign_in_non_owner
|
||||
get :generate_matches, id: 1
|
||||
redirect
|
||||
end
|
||||
|
||||
test "logged in school delegate cannot generate matches" do
|
||||
wipe
|
||||
sign_in_school_delegate
|
||||
get :generate_matches, id: 1
|
||||
redirect
|
||||
@@ -231,7 +228,6 @@ include Devise::TestHelpers
|
||||
end
|
||||
|
||||
test "logged in tournament delegate can generate matches" do
|
||||
wipe
|
||||
sign_in_delegate
|
||||
get :generate_matches, id: 1
|
||||
success
|
||||
|
||||
Reference in New Issue
Block a user