Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jorg-vr committed Dec 17, 2024
1 parent be4b3a9 commit d373898
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions test/system/activities_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions test/system/scratchpad_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit d373898

Please sign in to comment.