From 6803efc0230525c3dbf0ea8e33cbfe39e98dc78c Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Fri, 12 Aug 2022 11:39:42 +0200 Subject: [PATCH] Fix order-dependent specs The submission spec is removed as it was useless since 66c1b992 --- spec/concerns/file_parameters_spec.rb | 3 ++- spec/models/submission_spec.rb | 16 ---------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/spec/concerns/file_parameters_spec.rb b/spec/concerns/file_parameters_spec.rb index 8d00ca4c..c7470689 100644 --- a/spec/concerns/file_parameters_spec.rb +++ b/spec/concerns/file_parameters_spec.rb @@ -48,7 +48,8 @@ describe FileParameters do end it 'non existent file' do - non_existent_file = build(:file, context: hello_world, id: 42) + # Ensure to use an invalid id for the file. + non_existent_file = build(:file, context: hello_world, id: -1) expect(file_accepted?(non_existent_file)).to be false end end diff --git a/spec/models/submission_spec.rb b/spec/models/submission_spec.rb index 9b6a6ab5..06744512 100644 --- a/spec/models/submission_spec.rb +++ b/spec/models/submission_spec.rb @@ -123,22 +123,6 @@ describe Submission do end end end - - context 'with enough exercise feedback' do - let(:exercise) { create(:dummy_with_user_feedbacks, user_feedbacks_count: 42) } - let(:user) { 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 = create(:submission, exercise: exercise, user: create(:external_user)) - expect(submission.send(:redirect_to_feedback?)).to be_falsey - end - end - end end describe '#calculate_score' do