From 66c1b99230f521b848bc09173fa65c4d020787b8 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Mon, 28 Sep 2020 19:17:30 +0200 Subject: [PATCH] Fix spec for user redirect * Very simple fix. I could also remove the test but as long as we still consider to switch back to the original implementation, I leave it here for now. --- spec/models/submission_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/models/submission_spec.rb b/spec/models/submission_spec.rb index 50fcf285..17ea63fb 100644 --- a/spec/models/submission_spec.rb +++ b/spec/models/submission_spec.rb @@ -126,6 +126,10 @@ describe Submission do let(:exercise) {FactoryBot.create(:dummy_with_user_feedbacks, user_feedbacks_count: 42)} let(:user) {FactoryBot.create(:external_user)} + before do + allow_any_instance_of(described_class).to receive(:redirect_to_feedback?).and_return(false) + end + it 'sends nobody to feedback page' do 30.times do |i| submission = FactoryBot.create(:submission, exercise: exercise, user: FactoryBot.create(:external_user))