From d3738988b9992954220a32e02a8b51a3800b6974 Mon Sep 17 00:00:00 2001 From: "jorg.vr" Date: Tue, 17 Dec 2024 16:44:27 +0100 Subject: [PATCH] Fix tests --- test/system/activities_test.rb | 4 ++-- test/system/scratchpad_test.rb | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/system/activities_test.rb b/test/system/activities_test.rb index b16a99fd28..57a3db94df 100644 --- a/test/system/activities_test.rb +++ b/test/system/activities_test.rb @@ -70,8 +70,8 @@ class ActivitiesTest < ApplicationSystemTestCase end test 'should not be able to submit to invalid exercise' do - @instance.update!(status: :not_valid) - visit exercise_path(id: @instance.id) + exercise = create :exercise, status: :not_valid + visit exercise_path(id: exercise.id) assert_no_selector '#editor-process-btn' end diff --git a/test/system/scratchpad_test.rb b/test/system/scratchpad_test.rb index 4a75271dc4..9aec077e13 100644 --- a/test/system/scratchpad_test.rb +++ b/test/system/scratchpad_test.rb @@ -17,12 +17,6 @@ class ScratchpadTest < ApplicationSystemTestCase @course.series.first.activities << @exercise sign_in @zeus - - # Open Papyros ready for use - visit(course_activity_path(course_id: @course.id, id: @exercise.id)) - - assert_selector '#scratchpad-offcanvas-show-btn' - find_by_id('scratchpad-offcanvas-show-btn').click end def codemirror_send_keys(parent, code) @@ -41,6 +35,12 @@ def run_code(code) test 'Scratchpad can run code' do skip("This test fails infrequently, but i haven't figured out why yet") + # Open Papyros ready for use + visit(course_activity_path(course_id: @course.id, id: @exercise.id)) + + assert_selector '#scratchpad-offcanvas-show-btn' + find_by_id('scratchpad-offcanvas-show-btn').click + ## Hello World! code = "print(\"Hello World!\")\n" run_code code