Simplify code finding the tournament

Co-Authored-By: Thor77 <thor77@thor77.org>
This commit is contained in:
Daniel Schädler 2019-05-22 09:00:28 +02:00
parent 0337b6fad8
commit 5457d50277
1 changed files with 1 additions and 1 deletions

View File

@ -6,7 +6,7 @@ RSpec.describe MatchesController, type: :controller do
before do before do
@match = create(:match, state: :not_started) @match = create(:match, state: :not_started)
@tournament = create(:group_stage_tournament, stage_count: 3) @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) @match.match_scores = create_pair(:match_score)
end end