From aec37028351f1b47be7a9f556e878e08b7a1f28c Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Mon, 19 Oct 2015 19:45:43 -0400 Subject: [PATCH] update bout board when matches end --- app/models/match.rb | 1 + test/integration/pool_advancement_test.rb | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) 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)