From 5457d50277d2f7da8a97fcaedad130a064b62cc9 Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Wed, 22 May 2019 09:00:28 +0200 Subject: [PATCH] Simplify code finding the tournament Co-Authored-By: Thor77 --- spec/controllers/matches_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/matches_controller_spec.rb b/spec/controllers/matches_controller_spec.rb index ee47017..74f2da5 100644 --- a/spec/controllers/matches_controller_spec.rb +++ b/spec/controllers/matches_controller_spec.rb @@ -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