Simplify code finding the tournament
Co-Authored-By: Thor77 <thor77@thor77.org>
This commit is contained in:
parent
0337b6fad8
commit
5457d50277
|
|
@ -6,7 +6,7 @@ RSpec.describe MatchesController, type: :controller do
|
|||
before do
|
||||
@match = create(:match, state: :not_started)
|
||||
@tournament = create(:group_stage_tournament, stage_count: 3)
|
||||
@running_playoff_match = @tournament.stages.find { |s| s.level == 3 }.matches.first
|
||||
@running_playoff_match = @tournament.stages.find_by(level: 3).matches.first
|
||||
@match.match_scores = create_pair(:match_score)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue