Skip to content

Commit

Permalink
Merge branch 'release/6.6.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
jorg-vr committed Mar 14, 2023
2 parents f5d7b2a + 9df381b commit 7109b8b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/policies/series_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def resolve
.or(scope.where(course: { course_memberships: { status: :course_admin, user_id: user.id } }))
.distinct
else
scope.where(visibility: :visible)
scope.where(visibility: :open)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/00_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Application
module Version
MAJOR = 6
MINOR = 6
PATCH = 8
PATCH = 9

STRING = [MAJOR, MINOR, PATCH].compact.join('.')
end
Expand Down
22 changes: 22 additions & 0 deletions test/system/courses_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,26 @@ class CoursesTest < ApplicationSystemTestCase
assert_selector 'd-filter-tabs li:nth-of-type(4) a.active'
assert_selector '#courses-table-wrapper tbody tr', count: 1
end

test 'Can view content of visible_for_all course when not logged in' do
course = create :course, visibility: :visible_for_all, series_count: 3, activities_per_series: 2, submissions_per_exercise: 1
visit(course_path(:en, course.id))
assert_selector 'h2', text: course.name

assert_selector '.card.series', count: 3
assert_selector '.card.series .activity-table', count: 3
assert_selector '.card.series .activity-table tr', count: 9
end

test 'Cannot view non visible_for all courses when not logged in' do
course = create :course, visibility: :visible_for_institution, series_count: 3, activities_per_series: 2, submissions_per_exercise: 1, institution: create(:institution)
visit(course_path(:en, course.id))
# assert redirected to login page
assert_selector 'h1', text: 'Sign in'

course = create :course, visibility: :hidden, series_count: 3, activities_per_series: 2, submissions_per_exercise: 1
visit(course_path(:en, course.id))
# assert redirected to login page
assert_selector 'h1', text: 'Sign in'
end
end

0 comments on commit 7109b8b

Please sign in to comment.