From 4e38e6c4bf88b2d5a836ce7af2fcce913946f609 Mon Sep 17 00:00:00 2001 From: Andrew Cain Date: Mon, 22 Jul 2024 21:06:48 +1000 Subject: [PATCH] test: fix issues with file locn and tii features --- test/api/tii/tii_action_api_test.rb | 2 +- test/models/task_test.rb | 2 +- test/models/tii_user_accept_eula_test.rb | 4 ++++ test/sidekiq/tii_check_progress_job_test.rb | 3 ++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/test/api/tii/tii_action_api_test.rb b/test/api/tii/tii_action_api_test.rb index c81cd2b27..50d6b1f1e 100644 --- a/test/api/tii/tii_action_api_test.rb +++ b/test/api/tii/tii_action_api_test.rb @@ -15,7 +15,7 @@ def app setup do TiiAction.delete_all - + setup_tii_features_enabled setup_tii_eula # Create a task definition with two attachments diff --git a/test/models/task_test.rb b/test/models/task_test.rb index d78bf65c1..877ee3fca 100644 --- a/test/models/task_test.rb +++ b/test/models/task_test.rb @@ -732,7 +732,7 @@ def test_pdf_creation_fails_on_invalid_pdf folder = FileHelper.student_work_dir(:new, task) # Copy the file in - FileUtils.cp('test_files/submissions/corrupted.pdf', "#{folder}/001-code.cs") + FileUtils.cp(Rails.root.join('test_files/submissions/corrupted.pdf'), "#{folder}/001-code.cs") begin assert_not task.convert_submission_to_pdf(log_to_stdout: false) diff --git a/test/models/tii_user_accept_eula_test.rb b/test/models/tii_user_accept_eula_test.rb index df11250a4..0d131da78 100644 --- a/test/models/tii_user_accept_eula_test.rb +++ b/test/models/tii_user_accept_eula_test.rb @@ -4,6 +4,7 @@ class TiiUserAcceptEulaTest < ActiveSupport::TestCase include TestHelpers::TiiTestHelper def test_can_accept_tii_eula + setup_tii_features_enabled setup_tii_eula assert TurnItIn.eula_version.present? @@ -36,6 +37,7 @@ def test_can_accept_tii_eula def test_eula_accept_will_retry TiiAction.destroy_all + setup_tii_features_enabled setup_tii_eula user = FactoryBot.create(:user) @@ -102,6 +104,7 @@ def test_eula_accept_will_retry end def test_eula_accept_rate_limit + setup_tii_features_enabled setup_tii_eula # Prepare stub for call when eula is accepted and it fails @@ -137,6 +140,7 @@ def test_eula_accept_rate_limit end def test_eula_respects_global_errors + setup_tii_features_enabled setup_tii_eula # Prepare stub for call when eula is accepted and it fails diff --git a/test/sidekiq/tii_check_progress_job_test.rb b/test/sidekiq/tii_check_progress_job_test.rb index f030a98da..719129843 100644 --- a/test/sidekiq/tii_check_progress_job_test.rb +++ b/test/sidekiq/tii_check_progress_job_test.rb @@ -6,7 +6,7 @@ class TiiCheckProgressJobTest < ActiveSupport::TestCase def test_check_eula_change TiiAction.delete_all - + setup_tii_features_enabled setup_tii_eula # Create a task definition with two attachments @@ -217,6 +217,7 @@ def test_that_progress_checks_eula_change def test_waits_to_process_action setup_tii_eula + setup_tii_features_enabled # Will test with user eula user = FactoryBot.create(:user)