From 060f3d04223e86bae9a1517446ab94ba7199a429 Mon Sep 17 00:00:00 2001 From: Malaber Date: Sun, 16 Mar 2025 13:44:37 +0100 Subject: [PATCH] =?UTF-8?q?Hopefully=20=F0=9F=A4=9E=20fix=20flaky=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/controllers/matches_controller_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/controllers/matches_controller_spec.rb b/spec/controllers/matches_controller_spec.rb index 1beabe4..2d9482b 100644 --- a/spec/controllers/matches_controller_spec.rb +++ b/spec/controllers/matches_controller_spec.rb @@ -203,6 +203,9 @@ RSpec.describe MatchesController, type: :controller do let(:context) { double(:context, success?: false) } it 'returns unprocessable entity' do + # mock match.winner to be the first team of the match to skip winner check here + allow(@running_playoff_match).to receive(:winner).and_return(@running_playoff_match.match_scores.first.team) + put :update, params: { id: @running_playoff_match.to_param }.merge(finished) expect(response).to have_http_status(:unprocessable_entity) end