Check if .winner returns a Team

This is done to prevent Test from succeeding if both
.winner and .teams return nil
This commit is contained in:
Daniel Schädler 2019-05-26 20:01:14 +02:00
parent 74b345dce4
commit 21c79665e1
1 changed files with 1 additions and 0 deletions

View File

@ -96,6 +96,7 @@ RSpec.describe MatchesController, type: :controller do
it 'populates the match below' do
match_below = @tournament.stages.find { |s| s.level == 2 }.matches
.find { |m| m.position == @running_playoff_match.position / 2 }.reload
expect(@running_playoff_match.winner).to be_a(Team)
expect(match_below.teams).to include(@running_playoff_match.winner)
end
end