Add ProgrammingGroup & ProgrammingGroupMembership

* User can create programming group with other users for exercise
* Submission is shared in a group
* Also adjust specs
This commit is contained in:
kiragrammel
2023-08-10 17:07:04 +02:00
committed by Sebastian Serth
parent 0234414bae
commit 319c3ab3b4
42 changed files with 715 additions and 276 deletions

View File

@ -25,7 +25,7 @@ describe FileParameters do
it 'new file' do
submission = create(:submission, exercise: hello_world, id: 1337)
controller.instance_variable_set(:@current_user, submission.contributor)
controller.instance_variable_set(:@current_contributor, submission.contributor)
new_file = create(:file, context: submission)
expect(file_accepted?(new_file)).to be true
@ -61,7 +61,7 @@ describe FileParameters do
submission_learner1 = create(:submission, exercise: hello_world, contributor: learner1)
_submission_learner2 = create(:submission, exercise: hello_world, contributor: learner2)
controller.instance_variable_set(:@current_user, learner2)
controller.instance_variable_set(:@current_contributor, learner2)
other_submissions_file = create(:file, context: submission_learner1)
expect(file_accepted?(other_submissions_file)).to be false
end

View File

@ -22,6 +22,7 @@ describe Lti do
expect(controller.session).to receive(:delete).with(:external_user_id)
expect(controller.session).to receive(:delete).with(:study_group_id)
expect(controller.session).to receive(:delete).with(:embed_options)
expect(controller.session).to receive(:delete).with(:pg_id)
controller.send(:clear_lti_session_data)
end
end