forbid users to import an exercise they do not have access to (previously a new one was created)
This commit is contained in:
@ -155,8 +155,8 @@ describe ProformaService::Import do
|
||||
context 'when another user imports the exercise' do
|
||||
let(:import_user) { FactoryBot.create(:teacher) }
|
||||
|
||||
it 'raises a validation error' do
|
||||
expect { imported_exercise.save! } .to raise_error ActiveRecord::RecordInvalid
|
||||
it 'raises a proforma error' do
|
||||
expect { imported_exercise.save! } .to raise_error Proforma::ExerciseNotOwned
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user