diff --git a/app/models/match.rb b/app/models/match.rb index cd8f3bc..f596580 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -17,6 +17,7 @@ class Match < ActiveRecord::Base @w2 = Wrestler.find(self.w2) @w1.advanceInBracket @w2.advanceInBracket + self.mat.assignNextMatch end end diff --git a/test/integration/pool_advancement_test.rb b/test/integration/pool_advancement_test.rb index eb82583..39b871a 100644 --- a/test/integration/pool_advancement_test.rb +++ b/test/integration/pool_advancement_test.rb @@ -1,9 +1,6 @@ require 'test_helper' class PoolAdvancementTest < ActionDispatch::IntegrationTest - test "the truth" do - assert true - end def setup @tournament = Tournament.find(1) @@ -30,6 +27,9 @@ class PoolAdvancementTest < ActionDispatch::IntegrationTest @match.finished = 1 @match.winner_id = translateNameToId(winner) @match.win_type = "Decision" + #Need to manually assign mat_id because thise weight class is not currently assigned a mat + @mat = @tournament.mats.first + @match.mat_id = @mat.id @match.save end def translateNameToId(wrestler)