From 7d66aa3e9c2826310ccb4c48d69a83c54ec72f86 Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Fri, 10 May 2019 23:50:02 +0200 Subject: [PATCH] Keep owner of Matches in variable --- spec/controllers/matches_controller_spec.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/controllers/matches_controller_spec.rb b/spec/controllers/matches_controller_spec.rb index f3b4956..af73137 100644 --- a/spec/controllers/matches_controller_spec.rb +++ b/spec/controllers/matches_controller_spec.rb @@ -5,8 +5,10 @@ require 'rails_helper' RSpec.describe MatchesController, type: :controller do before do @match = create(:match, state: :not_started) + @match_owner = @match.owner @tournament = create(:group_stage_tournament, stage_count: 3) @running_playoff_match = @tournament.stages.find { |s| s.level == 3 }.matches.first + @running_playoff_match_owner = @running_playoff_match.owner @match.match_scores = create_pair(:match_score) end @@ -40,7 +42,7 @@ RSpec.describe MatchesController, type: :controller do context 'as owner' do before(:each) do - apply_authentication_headers_for @match.owner + apply_authentication_headers_for @match_owner end context 'with valid params' do @@ -75,7 +77,7 @@ RSpec.describe MatchesController, type: :controller do end before(:each) do - apply_authentication_headers_for @running_playoff_match.owner + apply_authentication_headers_for @running_playoff_match_owner end it 'stops the match' do