fix file_type selection for Makefile

This commit is contained in:
Karol
2022-12-13 21:17:27 +01:00
committed by Sebastian Serth
parent 70933ac9da
commit 454b34275c
2 changed files with 15 additions and 1 deletions

View File

@ -232,6 +232,20 @@ describe ProformaService::ConvertTaskToExercise do
expect { convert_to_exercise_service.save! }.to change(FileType, :count).by(1)
end
end
context 'when file has a Makefile' do
let!(:file_type) { create(:makefile) }
let(:filename) { 'Makefile' }
it 'creates a new Exercise on save' do
expect { convert_to_exercise_service.save! }.to change(Exercise, :count).by(1)
end
it 'creates an exercise with a file with correct attributes' do
expect(convert_to_exercise_service.files.first.file_type).to eql file_type
end
end
end
context 'when task has a model-solution' do