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:
parent
74b345dce4
commit
21c79665e1
|
|
@ -96,6 +96,7 @@ RSpec.describe MatchesController, type: :controller do
|
||||||
it 'populates the match below' do
|
it 'populates the match below' do
|
||||||
match_below = @tournament.stages.find { |s| s.level == 2 }.matches
|
match_below = @tournament.stages.find { |s| s.level == 2 }.matches
|
||||||
.find { |m| m.position == @running_playoff_match.position / 2 }.reload
|
.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)
|
expect(match_below.teams).to include(@running_playoff_match.winner)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue