activate course shard for student_view student
test plan - have MRA - on course from other domain attempt to create student view student - it should work fixes VICE-733 flag=none Change-Id: I685a41ea0be38342cd3dfdeac92e4f1267bb64d2 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245750 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Jacob Burroughs <jburroughs@instructure.com> QA-Review: Rob Orton <rob@instructure.com> Product-Review: Rob Orton <rob@instructure.com>
This commit is contained in:
parent
d5f631b9c5
commit
5ac66f98e5
|
@ -3172,6 +3172,7 @@ class Course < ActiveRecord::Base
|
|||
fake_student = User.new(:name => t('student_view_student_name', "Test Student"))
|
||||
fake_student.preferences[:fake_student] = true
|
||||
fake_student.workflow_state = 'registered'
|
||||
fake_student.shard = self.shard
|
||||
fake_student.save
|
||||
# hash the unique_id so that it's hard to accidently enroll the user in
|
||||
# a course by entering something in a user list. :(
|
||||
|
|
|
@ -4964,6 +4964,13 @@ describe Course do
|
|||
end
|
||||
end
|
||||
|
||||
it 'should activate shard for new student view students' do
|
||||
course_model
|
||||
@shard1.activate do
|
||||
expect { @course.student_view_student }.not_to raise_error
|
||||
end
|
||||
end
|
||||
|
||||
it "should grant enrollment-based permissions regardless of shard" do
|
||||
@shard1.activate do
|
||||
account = Account.create!
|
||||
|
|
Loading…
Reference in New Issue