still allow students to see the course if dates are unrestricted
fixes CNVS-36064 test plan In the settings of a course in an active term, set the course end date in the past Leave "Users can only participate in the course between these dates" unchecked in the course settings page. Enable "Restrict students from viewing course after end date" As an active student in the course view the course list. It should show as active Change-Id: Ic266f30028033903148113b3518ef1f68fefb5ed Reviewed-on: https://gerrit.instructure.com/107232 Reviewed-by: Dan Minkevitch <dan@instructure.com> QA-Review: David Tan <dtan@instructure.com> Tested-by: Rob Orton <rob@instructure.com> Product-Review: Rob Orton <rob@instructure.com>
This commit is contained in:
parent
c3b7a550f6
commit
8cef8a4d4e
|
@ -431,7 +431,7 @@ class CoursesController < ApplicationController
|
|||
|
||||
state = e.state_based_on_date
|
||||
if [:completed, :rejected].include?(state) ||
|
||||
(e.course.conclude_at && e.course.conclude_at < Time.now) # strictly speaking, these enrollments are perfectly active but enrollment dates are terrible
|
||||
(e.course.conclude_at && e.course.conclude_at < Time.now && e.course.restrict_enrollments_to_course_dates?) # strictly speaking, these enrollments are perfectly active but enrollment dates are terrible
|
||||
@past_enrollments << e unless e.workflow_state == "invited" || e.restrict_past_view?
|
||||
else
|
||||
start_at, end_at = e.enrollment_dates.first
|
||||
|
|
|
@ -164,8 +164,8 @@ describe CoursesController do
|
|||
user_session(@student)
|
||||
get 'index'
|
||||
expect(response).to be_success
|
||||
expect(assigns[:past_enrollments]).to match_array([enrollment3, enrollment2, enrollment1])
|
||||
expect(assigns[:current_enrollments]).to eq [enrollment4]
|
||||
expect(assigns[:past_enrollments]).to match_array([enrollment3, enrollment2])
|
||||
expect(assigns[:current_enrollments]).to eq [enrollment4, enrollment1]
|
||||
expect(assigns[:future_enrollments]).to be_empty
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue