Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jorg-vr committed Jul 2, 2024
1 parent 37f9faf commit 399771f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/controllers/activities_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,7 @@ class ExerciseDescriptionTest < ActionDispatch::IntegrationTest

test 'activities for hidden series should only be shown with token' do
course = courses(:course1)
course.subscribed_members << users(:student)
exercise = exercises(:python_exercise)
other_exercise = create :exercise
series = create :series, course: course, exercises: [exercise, other_exercise], visibility: :hidden
Expand Down
3 changes: 3 additions & 0 deletions test/controllers/series_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -297,20 +297,23 @@ def assert_show_and_overview(authorized, token: nil)

test 'student should see hidden series with token' do
sign_in @student
@series.course.subscribed_members << @student
@series.update(visibility: :hidden)

assert_show_and_overview true, token: @series.access_token
end

test 'student should not see hidden series with wrong token' do
sign_in @student
@series.course.subscribed_members << @student
@series.update(visibility: :hidden)

assert_show_and_overview false, token: 'hunter2'
end

test 'student should not see closed series with token' do
sign_in @student
@series.course.subscribed_members << @student
@series.update(visibility: :closed)

assert_show_and_overview false, token: @series.access_token
Expand Down

0 comments on commit 399771f

Please sign in to comment.